Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the terminal command to find what version of Git is currently installed on my system?

share|improve this question

migrated from stackoverflow.com Oct 18 '11 at 5:47

This question came from our site for professional and enthusiast programmers.

    
Did you ever consider using --version or -v –  Adrian Cornish Oct 18 '11 at 3:41

1 Answer 1

up vote 30 down vote accepted

Yeah, simple - git --version (holds true for most applications)


If you get -bash: git: command not found when you run git --version it means git is not installed or it is not on PATH.

  1. Make sure git is installed.

    • Git is usually installed at /usr/local/git/
    • Make sure there is a binary file where you installed git. If not, install git.
  2. If git is installed, then it is mostly likely not on PATH

    • Find the path where you installed it and do something like this to add it to the path and set in your profile:

      echo 'export PATH=/usr/local/git/bin:$PATH' >> ~/.profile

    • Then make sure you restart terminal before trying to run any git commands

share|improve this answer
    
Beat me by four seconds! Yeah, most terminal commands have a -v or --version flag. –  ceejayoz Oct 18 '11 at 3:37
    
Ok, thats what I thought. When I try that I get "-bash: git: command not found" I know git is installed. Been using it for some time now. I am in my users directory if that matters. –  zechdc Oct 18 '11 at 3:38
1  
@ceejayoz, -v usually means "verbose". –  rid Oct 18 '11 at 3:38
    
@zechdc, just install it. –  rid Oct 18 '11 at 3:41
    
@Radu If it has a verbose flag. I see -v as an alias for --version fairly commonly. php -v for example. –  ceejayoz Oct 18 '11 at 3:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.