Skip to content

Commit 8a26365

Browse files
author
Eric James Michael Ritz
committed
Add an easier-to-read way to delete a remote branch
Since 2010 Git supports the `--delete` argument for git-push as an alias for the `:branch` syntax, i.e. these commands are equivalent: $ git push origin :foo $ git push origin --delete foo This patch changes the tip to use the `--delete` argument on the grounds that it is easier to remember, easier to understand, and easily available since it is unlikely for people to be using a version of Git which is more than five years old. Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
1 parent 3ed8741 commit 8a26365

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ git branch -d <local_branchname>
9090

9191
## Delete remote branch
9292
```sh
93+
git push origin --delete <remote_branchname>
94+
```
95+
96+
97+
__Alternatives:__
98+
```sh
9399
git push origin :<remote_branchname>
94100
```
95101

tips.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
},
4646
{
4747
"title": "Delete remote branch",
48-
"tip": "git push origin :<remote_branchname>"
48+
"tip": "git push origin --delete <remote_branchname>",
49+
"alternatives": ["git push origin :<remote_branchname>"]
4950
},
5051
{
5152
"title": "Undo local changes with the last content in head",

0 commit comments

Comments
 (0)