Talk about git remote prune origin

Source: Internet
Author: User

There is a git branch–a used to view all the branches, both local and remote, in the commands you often use. But for a long time you will find that some of the branches have been deleted in the remote, but you can still see the deleted branches in your local area.

You can use the command, GIT remote show origin to see some information about origin, including whether the branch is tracking or not.

650) this.width=650; "title=" 1 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 1 "src=" http://s3.51cto.com/wyfs02/M01/8A/20/ Wkiom1gnvlwgscwcaabm6nu50eg631.png "width=" 703 "height=" 253 "/>

Local refs configured for ' git push ', this column shows which branches you push on origin.

650) this.width=650; "title=" 2 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 2 "src=" http://s3.51cto.com/wyfs02/M00/8A/20/ Wkiom1gnvlajx-0yaaa9wupm6ba907.png "width=" 731 "height="/>

Develop_newfeature_apiwrapper, branch on the remote, we're going to remove him now.

650) this.width=650; "title=" 3 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 3 "src=" http://s3.51cto.com/wyfs02/M02/8A/1C/wKioL1gnvleh6gINAABzZO_ Fpyo758.png "width=" 1105 "height=" 361 "/>

Click the Trash and delete it. Then go back to the local to see all the branches.

650) this.width=650; "title=" 4 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 4 "src=" http://s3.51cto.com/wyfs02/M00/8A/1C/ Wkiol1gnvljqv7ggaaa9cvrjrug772.png "width=" 687 "height=" 134 "/>

It still exists. But you'll find the problem by looking at Git remote show origin.

650) this.width=650; "title=" 5 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 5 "src=" http://s3.51cto.com/wyfs02/M01/8A/20/ Wkiom1gnvlmwfp1faabn8wyiblc258.png "width=" 773 "height=" 244 "/>

Tip You can remove this branch from git remote prune. (That is, you can refresh the local repository to keep these changes synchronized with the remote repository)

650) this.width=650; "title=" 6 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 6 "src=" http://s3.51cto.com/wyfs02/M02/8A/20/ Wkiom1gnvlqrltrmaaattko7z6m638.png "width=" 441 "height=" "/>

This remote deleted branch will also be deleted in your local repository. Then check it out with Git branch–a.

650) this.width=650; "title=" 7 "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" 7 "src=" Http://s3.51cto.com/wyfs02/M02/8A/1C/wKioL1gnvlvRE-F_ Aaauqiq5c6w100.png "width=" 605 "height=" 121 "/>

No longer exists.

King Qingyue Culture

Source: http://www.cnblogs.com/wangiqngpei557/

This article is copyrighted by the author and the blog Park, welcome reprint, but without the consent of the author must retain this statement, and on the article page

Chat git remote prune origin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.