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

Re: git-branch --print-current

From: Arnaud Lacombe <hidden>
Date: 2016-06-15 22:45:52

Hi,

On Sun, Jan 4, 2009 at 7:49 AM, demerphq [off-list ref] wrote:
2009/1/4 Karl Chen [off-list ref]:
quoted
On 2009-01-04 00:21 PST, Arnaud Lacombe writes:
   Arnaud> $ git branch | awk '/^\*/ {print $2}'

Yet another addition to the list of ways to pipeline it, this one
probably the shortest :)
Unfortunately it doesnt work well when you arent on a branch:

 $ git branch | awk '/^\*/ {print $2}'
 (no

So far two apparently expert git people have given solutions to this
problem that don't elegantly handle the edge cases.
my bad:
$ git branch | awk '/^\*/ {print substr($0, 3)}'

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