Trouble setting up git with my GitHub Account error: could not lock config file

后端 未结 19 1587
甜味超标
甜味超标 2020-11-28 05:52

I\'m getting this error when trying to set the global config:

$ git config --global user.name \"Your Name Here\"
error: could not lock config file /pathto/fi         


        
相关标签:
19条回答
  • 2020-11-28 06:07

    I've gotten this error when a lock file exists for gitconfig. Try and find and remove .gitconfig.lock (on my linux box it was in my home dir)

    0 讨论(0)
  • 2020-11-28 06:08

    Windows Users: Ensure your Environment Variables are correctly setup.

    I had the following for my account username 'paperclip':

    My Computer (right-click) > Properties > Advanced (tab) > Environment Variables (under System Variables):

    HOME -> %HOMEPATH%

    HOMEPATH -> C:\Documents and Settings\paperclip

    It seems like Git could not resolve / expand %HOME% to %HOMEPATH% as you would it expect it to. Instead I needed to make %HOME% the same as %HOMEPATH% by changing it to:

    HOME -> C:\Documents and Settings\paperclip

    0 讨论(0)
  • 2020-11-28 06:08

    Update you Git client plugin. It worked for me =) https://issues.jenkins-ci.org/browse/JENKINS-21016

    0 讨论(0)
  • 2020-11-28 06:10

    You can also try issuing the command while in your home directory.

    0 讨论(0)
  • 2020-11-28 06:10

    So I know this thread is Old, but I had the same issue and fixed it. Hopefully this works for someone else.

    When i tried using "sudo" or anything in powershell/cmd it was an unrecognized command. So i reinstalled git for windows, during the install it failed and pointed me to C:/ProgramFiles/git/etc/gitconfig I deleted that file, and reinstalled. Same Error when saving credentials, So i moved the newly created gitconfig from programfiles, to my HomePath location C:/Users/Name

    Now I can save credentials under file-->Options-->git Finally, I can commit/push on githubdesktop

    0 讨论(0)
  • 2020-11-28 06:12

    just do Run as Administrator.......you need to run the program in the run as administrator mode in windows

    0 讨论(0)
提交回复
热议问题