[git-users] Fully compatibly way to get git branch and current SHA

2013-01-03 Thread Yoshiki Vázquez Baeza
Hello everyone, I'm currently having a problem trying to retrieve the current git branch and the current git SHA of a repository, the main problem being that the method I'm using does not work in different versions of git. Right now I'm pulling out this information with the following two comman

Re: [git-users] Fully compatibly way to get git branch and current SHA

2013-01-03 Thread John McKown
#current branch name git branch #or branch=$(git branch | cut -d ' ' -f 2) #sha of head head=$(cat .git/refs/heads/${branch} I don't know for certain that these will work for all releases. -- Maranatha! John McKown On Jan 3, 2013 9:41 PM, "Yoshiki Vázquez Baeza" wrote: > Hello everyone, > > I'

Re: [git-users] Fully compatibly way to get git branch and current SHA

2013-01-03 Thread Yoshiki Vázquez Baeza
Hello John, Thanks for the prompt response, this brings me to a second question, is there a "standard" version of git that is installed in most systems or what seems to be the most widely used version of git that people use. Sorry if this question is to broad. Further tests show me that the co