1

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?

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
Vish
  • 383
  • 2
  • 8
  • 25
  • This may help - http://stackoverflow.com/questions/14959972/trouble-setting-up-git-with-my-github-account-error-could-not-lock-config-file. – Larry Borsato Dec 07 '14 at 04:39
  • Tried create file and the previous question. None worked – Vish Dec 07 '14 at 05:00
  • @Lary, I saw the solution and it does not seem to address the problem I have. I found the solution and it had to do with the git $path pointing to the default installation via XCODE – Vish Dec 08 '14 at 19:34

1 Answers1

1

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.

Vish
  • 383
  • 2
  • 8
  • 25