On Thu, 4 Sep 2014, Barry Smith wrote: > > Satish, > > Can we dump the branch name to configure.log as well so I don’t need to > remember the incantation git branch -r —contains ? > > Barry
Caveat: branchname is not a unique string - and some user branch names can be misleading [one could even call a random branch 'next' or 'maint' in their clone]. And there is also deteached heads.. Jed, How do I get a branch name? I would assume 'git branch' would give this info - but it does not [it gives a big list] http://stackoverflow.com/questions/6245570/how-to-get-current-branch-name-in-git has too many options - most are not suitable.. git branch | sed -n '/\* /s///p' This is most appropriate. Is this the one to use? [git prompt also does it properly..] Thanks, Satish ------- balay@asterix /home/balay/petsc (master) $ git branch | sed -n '/\* /s///p' master balay@asterix /home/balay/tmp/petsc ((e648208...)) $ git branch | sed -n '/\* /s///p' (detached from origin/master)
