Reputation: 383
I’m trying to setup the global config settings for my git installation and when I run the command
git config —global user.name “myname”
I get the following error msg:
error: could not lock config file /Users/vc/.gitconfig: No such file
or directory
my git version on my mac git version 1.9.3 (Apple Git-50)
How can I fix this error?
Upvotes: 1
Views: 1576
Reputation: 383
I found the solution on the following site:
http://coolestguidesontheplanet.com/install-update-latest-version-git-mac-osx-10-9-mavericks/
Under the article, but before you do that, please delete any gui based git installation and then download the latest version of git and follow the instructions below under the title.
Trumping Xcodes Older Git
If you have Xcode already installed and have installed command line tools then you alreay have Git, probably an older version which is distributed with Xcode this is installed in:
/usr/local/bin To run the lastest version you need to adjust your shell path:
/usr/local/git/bin/git You need to add add the above path to the beginning of your shell path to take precedence over the other path, the path will be set in either .bashrc or .bash_profile in your home directory.
So add in
/usr/local/git/bin to the path similar to the below:
export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:$PATH"
Restart or reload the Terminal and the newer Git version will now be used.
Upvotes: 1