git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] branch: implement shortcut to delete last branch
@ 2018-03-23  2:09 Aaron Greenberg
  2018-03-23  2:09 ` Aaron Greenberg
  2018-03-23  8:56 ` Jeff King
  0 siblings, 2 replies; 9+ messages in thread
From: Aaron Greenberg @ 2018-03-23  2:09 UTC (permalink / raw)
  To: git; +Cc: peff, p

This patch gives git-branch the ability to delete the previous
checked-out branch using the "-" shortcut. This shortcut already exists
for git-checkout, git-merge, and git-revert. One of my common workflows
is to do some work on a local topic branch and push it to a remote,
where it gets merged in to 'master'. Then, I switch back to my local
master, fetch the remote master, and delete the previous topic branch.

$ git checkout -b topic-a
$ # Do some work...
$ git commit -am "Implement feature A"
$ git push origin topic-a

# 'origin/topic-a' gets merged into 'origin/master'

$ git checkout master
$ git branch -d topic-a
$ # With this patch, a user could simply type
$ git branch -d -

I think it's a useful shortcut for cleaning up a just-merged branch
(or a just switched-from branch.)


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-26 16:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23  2:09 [PATCH] branch: implement shortcut to delete last branch Aaron Greenberg
2018-03-23  2:09 ` Aaron Greenberg
2018-03-23  8:56 ` Jeff King
2018-03-23  9:00   ` Jeff King
2018-03-23 22:40   ` [PATCH v2] " Aaron Greenberg
2018-03-23 22:40     ` [PATCH] " Aaron Greenberg
2018-03-26  8:10     ` [PATCH v2] " Jeff King
2018-03-26 12:41       ` git
2018-03-26 16:49         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).