Last active
September 22, 2022 07:59
-
Star
(133)
You must be signed in to star a gist -
Fork
(55)
You must be signed in to fork a gist
-
-
Save cmatskas/454e3369e6963a1c8c89 to your computer and use it in GitHub Desktop.
Git Delete Branch commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Delete a remote branch | |
$ git push origin --delete <branch> # Git version 1.7.0 or newer | |
$ git push origin :<branch> # Git versions older than 1.7.0 | |
## Delete a local branch | |
$ git branch --delete <branch> | |
$ git branch -d <branch> # Shorter version | |
$ git branch -D <branch> # Force delete un-merged branches | |
## Delete a local remote-tracking branch | |
$ git branch --delete --remotes <remote>/<branch> | |
$ git branch -dr <remote>/<branch> # Shorter | |
$ git fetch <remote> --prune # Delete multiple obsolete tracking branches | |
$ git fetch <remote> -p # Shorter |
thanks
thanks
tks bro
tkrl6cbb
good man
thx :)
Beautiful...wrapping up w branch deletion after a checkout commit history run. tnx
tq
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many thanks!