

If you leave off the portion, then you’re basically saying, “Take nothing on my side and make it be. A way to remember this command is by recalling the git push : syntax that we went over a bit earlier. You may want to dog-ear this page, because you’ll need that command, and you’ll likely forget the syntax.

If you want to delete your serverfix branch from the server, you run the following: $ git push origin :serverfixīoom. You can delete a remote branch using the rather obtuse syntax git push. Suppose you’re done with a remote branch - say, you and your collaborators are finished with a feature and have merged it into your remote’s main branch (or whatever branch your stable code-line is in).
#Git delete branch reflect on github pro
Delete Remote Branch įrom Chapter 3 of Pro Git by Scott Chacon: Deleting Remote Branches Therefore, the version of Git you have installed will dictate whether you need to use the easier or harder syntax. Starting with Git v2.8.0, you can also use git push with the -d option as an alias for -delete. Which was added in Git v1.5.0 "to delete a remote branch or a tag." Which might be easier to remember than $ git push : You will receive an error if you try to delete the currently selected branch.Īs of Git v1.7.0, you can delete a remote branch using $ git push -delete.As of Git v2.3, git branch -d (delete) learned to honor the -f (force) flag.The -D option is an alias for -delete -force, which deletes the branch "irrespective of its merged status.".The -d option is an alias for -delete, which only deletes the branch if it has already been fully merged in its upstream branch.To delete the local branch, use one of the following: git branch -d
