Git error: failed to execute configuration file

I am trying to add a new remote repository (GitHub) to an existing project, and I get an error message that I have never seen before and do not understand:

$ git remote add github git@github.com :me/myrepo.git error: could not commit config file .git/config 

What? Why should I execute the git configuration file? And how do I make this stop?

I am on a Mac with a relatively new installation of most of my tools. I think this is the first time I tried to add a remote to the repo on this machine.

+4
source share
2 answers

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.

+5
source

This may be a permission issue, especially for automated jobs running on Windows, which may have fewer permissions than the interactive login of the same user. From this answer on ServerFault :

Each Windows login session (NT version, that is, the machine) has a “security token” - a data structure that describes, among other things, the groups that the user represented by the token is a member of.

An “interactive” identifier is not a group that you can manually place members, but rather is added by the operating system automatically when a security token is created for a user who has a Windows GUI. This is similar to the “Network” identity, which is automatically added to tokens for users who access the machine through the network.

These automatically created group memberships allow you to create permissions that can allow or deny access to resources based on how the user accesses the machine. This complements the resolution of the default behavior for arbitration access by default: access to the resource.

0
source

Source: https://habr.com/ru/post/1501818/


All Articles