Can't set git config values: Could not lock config file - File exists

I’m having trouble updating git configuration values. Whenever I try, I get an error saying could not lock config file, and when I try to delete the .gitconfig file, I get the error No such file or directory.

MacBook-Pro-10:~ Chris$ git config --global user.name "Chris Marshall"
error: could not lock config file /Users/Chris/.gitconfig: File exists

MacBook-Pro-10:~ Chris$ rm ~/.gitconfig
rm: /Users/Chris/.gitconfig: No such file or directory

Does anyone know why this might be happening?

It seems that the .gitconfig file does not exist in the specified directory. You can try creating a new .gitconfig file using the following command:

touch ~/.gitconfig

Then, you can try updating the git configuration values again using the git config command.