简体   繁体   English

Windows github工具-使用分支取消发布还是删除?

[英]windows github tool - use branch unpublish or delete?

I'm new to Github and I've been using the windows github tool which has proved a great help and handled a lot of things like SSH keys, prompts commits, discard a commit, revert commit, and it has a combined mechanism of pull+merge & push (sync), and a lot! 我是Github的新手,我一直在使用Windows github工具 ,该工具已被证明非常有用 ,可以处理SSH密钥,提示提交,放弃提交,还原提交等许多事情,并且它具有组合的拉机制+合并并推送(同步),还有很多!

I'm learning it and trying to get its internal git command level executions. 我正在学习它,并试图获取其内部git命令级别的执行。 The other day, I merged a hotfix branch and then wanted to delete it - 前几天,我合并了一个修补程序分支,然后想要将其删除-

git branch -d hotfix

I need to know how to delete it from the server as well. 我还需要知道如何从服务器删除它。 What are the git equivalents of the following two actions available in manage branch in the windows tool - Windows工具的Manage分支中可用的以下两个操作的git等效项是什么-

  • Unpublish a branch - remove only from the server 取消发布分支-仅从服务器中删除
  • Delete a branch - remove locally and on server 删除分支-在本地和服务器上删除

Another thing I doubt is that the above git command was unable to remove the branch locally. 我怀疑的另一件事是上面的git命令无法在本地删除分支。 I executed it, it removed the branch (didn't show in $ git branch ) but if I restart the tool, the branch was still there! 我执行了它,它删除了该分支(未在$ git branch中显示),但是如果我重新启动该工具,该分支仍然存在! Was that a glitch? 那是小故障吗?

If someone has been using these, can you pls suggest the best approach (I don't want to be totally dependent on the tool, I want to learn git as well). 如果有人一直在使用这些工具,您能建议最好的方法吗(我不想完全依赖该工具,我也想学习git)。

In addition to 此外

git branch -d hotfix

you also can remove it from GitHub: 您还可以从GitHub删除它:

git push origin --delete hotfix

You can see more at " How do I delete a Git branch both locally and in GitHub? " 您可以在“ 如何在本地和GitHub中删除Git分支? ”中看到更多信息。


If you have already deleted branches locally, a simple: 如果您已经在本地删除了分支,则可以使用以下简单方法:

git push --prune origin

is enough to clean those same branches on your GitHub repo. 足以清理GitHub存储库中的相同分支。


The opposite situation is when you have deleted branches on GitHub, while they are still on your local repo. 相反的情况是您在GitHub上删除了分支,而分支仍在本地仓库中。
In that case: 在这种情况下:

git remote prune origin

See " cleaning up old remote git branches ". 请参阅“ 清理旧的远程git分支 ”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 新的统一Windows开发中心-如何取消发布/隐藏/删除应用程序? - New unified Windows Dev Center - how to unpublish/hide/delete app? Github在Windows上“无法发布此分支”错误 - Github “Failed to publish this branch” error on windows 如何将master合并到github中的Windows分支中? - how to merge master into branch in github for windows? 如何在 Windows 上可视化 GitHub 分支历史记录? - How can I visualize GitHub branch history on Windows? 反正有在Windows机器上使用valgrind工具吗? - Is there anyway to use valgrind tool on windows machine? 如何在Windows中使用Google Performance Tool - How to use google performance tool in windows 从Windows应用商店取消发布应用,并强制为当前用户卸载 - Unpublish app from Windows Store and force uninstall for current users Windows 7中2个文件夹之间的公用文件删除工具或技巧 - Any Tool/Trick to delete common files between 2 folders in Windows 7 在Windows中递归删除具有指定名称的文件夹的命令行工具? - Command line tool to delete folder with a specified name recursively in Windows? 捕获当前分支名称并在Windows上使用Git别名将其删除? - Capture current branch name and delete it using Git alias on Windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM