In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the method of deleting branches of git. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Git delete branch method: 1, delete local branch, use [git branch-- delete dev] to execute; 2, delete remote branch, use [git push origin-- delete branch] instruction; 3, delete tracking branch.
How to delete a branch in git:
1. Delete the local branch
When deleting a branch, we will use git branch-- delete dev to execute. Sometimes it is replaced by the abbreviation git branch-d dev. In use, we find that there is also the way to write git branch-D dev. What's the difference between them?
-d is the abbreviation of-- delete. When deleting a branch using-- delete, the branch must complete with its upstream branch merge (to learn about the upstream branch, you can click to view the link). If there is no upstream branch, it must be completely merge with HEAD.
-D is an abbreviation for-- delete-- force, which allows you to delete a branch without checking the merge status
-- force abbreviation-f, the function is to reset the current branch to the original point (startpoint), without using-- force, the git branch cannot modify an existing branch.
2. Delete remote branch
Directive git push origin-- delete branch, which also deletes the tracking branch
3. Delete the tracking branch
The tracking branch can be deleted by directing git branch-- delete-- remotes /. This operation does not really delete the remote branch, but the relationship between the deleted local branch and the remote branch, that is, the tracking branch.
As above, the remote branch and the tracking branch will be deleted through the command line git push origin-delete branch, and the tracking branch does not need to be deleted separately, but if the remote branch is deleted through the web page, the tracking branch will not be deleted.
After git version 1.6.6, you can delete the tracking branch separately through git fetch origin-- prune or its abbreviation git fetch origin-p
This is the end of this article on "how to delete branches of git". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.