Git error: could not commit config file

后端 未结 2 415
野的像风
野的像风 2021-01-13 15:40

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:

$          


        
2条回答
  •  醉酒成梦
    2021-01-13 16:07

    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.

提交回复
热议问题