What is the terminal command to find the version of Git currently installed on my system?
Asked
Active
Viewed 2e+01k times
1 Answers
109
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.
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.
- Git is usually installed at
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' >> ~/.profileThen make sure you restart terminal before trying to run any git commands
echo 'export PATH=/usr/local/git/bin:$PATH' >> ~/.profile– manojlds Oct 18 '11 at 03:48/usr/local/git. I ran that command and it created a file called .profile in my user directory. Still can't rungit --versionIs there more to it than just run that command? I am kinda a terminal newb. :) – zechdc Oct 18 '11 at 04:02/usr/local/gitdoes have agitbinary file. – manojlds Oct 18 '11 at 04:05