3 ms·
On the hobgoblin one it makes fun of how deleting a branch vs a remote use inconsistent syntax. I would add a third example, deleting a remote branch, which (a
by SilasX 10y ago
On the hobgoblin one it makes fun of how deleting a branch vs a remote use inconsistent syntax.
I would add a third example, deleting a remote branch, which (at least as of 2013) is
git push <remote name> :<branch name>
Neither `-d` nor `rm`!
- glitchdout 10y agoThat hasn't been true since 2010-02-13, when Git v1.7.0 was released. https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.0.txt https://github.com/git/git/blob/master/Documentation/RelNote...
- deleted 10y ago[deleted]
- pwdisswordfish 10y agoI actually quite like this syntax for deleting remote branches. You can think of it as a special case of git push $remote $local_commit:$remote_branch which updates the remote ref $remote_branch so that it points to $local_commit; here it updates the remote ref so that it points to nothing (which means deleting it). Sure, this is inconsistent with other git commands, but it's not completely illogical. Though I'd probably prefer something like git push $remote $remote_branch=$local_commit where the '=' makes you think of assignment, hinting at what this command actually does.