Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 150360  / 2 Years ago, wed, august 24, 2022, 1:54:36

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/file/.gitconfig: No such file or directory


and the file .gitconfig is already exists, anyone have any ideas??


More From » 12.10

 Answers
4

See if any of those tips help you:




  1. Verify if there's some file called ~/.gitconfig.lock. If that's the case just delete it.


  2. The file ~/.gitconfig belongs to you (use ls -la ~/.gitconfig to check). If it does not you can change the ownership using sudo chown <your_username>:<your_username> ~/.gitconfig




If none of these solves the problem you can always edit ~/.gitconfig using your favorite text editor. It is just a INI like file. An example:



$ cat ~/.gitconfig
[user]
name = my_username
email = [email protected]
[core]
editor = editor
pager = most
[color]
ui = auto
[merge]
conflictstyle = diff3


I am assuming the correct location is ~/.gitconfig. If that's not the case replace it with the correct path.



Hope it helps.


[#32606] Thursday, August 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hergy

Total Points: 64
Total Questions: 115
Total Answers: 109

Location: Saint Helena
Member since Tue, Nov 3, 2020
4 Years ago
;