Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: Wishlist for branch management

From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:48:08

On 2010.01.31 17:18:39 -0800, H. Peter Anvin wrote:
git branch --current

... list the current branch name, for use in scripts.  Equivalent to:
	"git branch | grep '^\*' | cut -c3-"
In scripts, plumbing should be used. I use:
	git rev-parse --symbolic-full-name HEAD

This gives either the full refname of the checked out branch head, e.g.
refs/heads/master, or HEAD in case of a detached HEAD.
git push --current

... push the current branch, and only the current branch...
Unless you want to push to a different ref remotely, e.g. pushing
refs/heads/master-public to refs/heads/master, you can use:
	git push <remote> HEAD

For example, when refs/heads/master is checked out, then:
	git push origin HEAD
acts the same as:
	git push origin refs/heads/master

Björn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help