![]() Regularly deleting local references to remote branches is a good practice for maintaining a usable Git repository. Don't slow yourself down by forcing yourself to sift through data you no longer need. Keeping your Git repository tidy may not seem urgent at first, but the more a repository grows, the more important it becomes to prune unnecessary data. ![]() It could be either your local branch or a remote branch available on your Git server repository. That's it! Maintaining your Git repository There may be some cases when you want to remove a branch. Next, prune the local reference to the remote branch: $ git remote prune origin Delete the local reference to the remote branch.įirst, list all the branches that you can delete or prune on your local repository: $ git remote prune origin -dry-run In this example, test-branch is the name of the topic branch that you deleted in the remote repository.ģ. Checkout the central branch of your repository (such as main or master). I did fast-forward merges on remote with many branches, and when I ran git branch -merged locally, it didn't show me any merged branches.1. The same might also happen is you do a fast-forward merged. In pull request cases where you do a different merge (for example, a squash merge), the branch history is altered and as a result git branch -merged will not show locally merged branches.
0 Comments
Leave a Reply. |