git

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


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??


Solution

  • A bit like in "Trouble setting up Tower with my GitHub Account - error: could not lock config file", check how that ~/.gitconfig file has been created.
    Ie: with which rights associated to it?

    Make also sure your $HOME variable is correctly set when you are executing the git config --global command.