Re: git-branch --print-current

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-branch --print-current

From: Karl Chen <hidden>
Date: 2016-06-15 22:45:51

quoted
quoted
quoted
quoted
On 2009-01-01 20:26 PST, David Aguilar writes:
    David> You might want to use 'git symbolic-ref' instead.

    David> $ git symbolic-ref HEAD | sed -e 's,refs/heads/,,'
    David> master

Thanks, that is better.

How about an option to git-symbolic-ref that gets rid of the
refs/heads/ ?

Re: git-branch --print-current

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:51

On Sat, Jan 03, 2009 at 06:18:36PM -0800, Karl Chen [off-list ref] wrote:
How about an option to git-symbolic-ref that gets rid of the
refs/heads/ ?
Make an alias?

git config alias.cb '!sh -c "git symbolic-ref HEAD|sed s,refs/heads/,,"'

$ git cb
master

(Where cb can stand for 'current branch', for example.)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help