Some git commands modify the git configuration file. One of them is git remote add
, because the remote file is stored in the configuration file.
To avoid problems with several git processes while changing the configuration file, git locks the configuration file before replacing it (by writing a lock file) and releases the lock (renaming the lock file to config).
Error message
error: could not commit config file .git/config
means that git was not able to properly release this lock. This probably means that either another process was working on one file, or there was some kind of file system error (or there was an error in git or your OS / libraries).
Unfortunately, git does not tell you what exactly was the problem, so you have to manually debug this. You can try running git with dtruss
to see what exactly is going wrong.
source share