I\'m trying to add a new remote repository (GitHub) to an existing project, and I\'m getting an error that I\'ve never seen before, and don\'t understand:
$
Some git commands modify the git config file. One of them is git remote add
, because the remote is stored in the config file.
To avoid problems with several git processes modifying the config file simultaneously, git will lock the config file before changing it (by writing a lock file), and release the lock afterwards (by renaming the lock file to the config file).
The error message
error: could not commit config file .git/config
means that git could not properly release this lock. This probably means that either another process was working on the same file, or there was some kind of filesystem error (or there's a bug in git or your OS/libraries).
Unfortunately, git does not tell you what exactly was the problem, so you'll have to manually debug this. You could try running git with dtruss to see what exactly is going wrong.
This could be a permissions issue, especially for automated jobs running on Windows that can have fewer permissions than an interactive login of the same user. From this answer on ServerFault:
Each logon session to a Windows (NT-based versions, that is) machine has a "security token"-- a data structure that describes, amongst other things, the groups that the user represented by the token is a member of.
The "Interactive" identity isn't a group that you can manually place members into, but rather is added by the operating system, automatically, when a security token is constructed for a user who has logged-on via the Windows Graphical User Interface. This is similar to the "Network" identity, which is added automatically to tokens created for users who are accessing the machine via the network.
These automatically-generated group memberships allow you to construct permissions that might allow or deny access to resources based on how the user is accessing the machine. This supplements the permission system's default behavior of arbitrating access based on who is accessing the resource.