Error: could not lock config file .git/config: File exists fatal: could not set :(

Problem
When you do a git remote add, you run into this error because of which you are not able to pull the next module

Error: could not lock config file .git/config: File exists

Solution
Run these on terminal:
ls -la ~/.gitconfig
sudo rm -rf ~/.gitconfig
sudo rm -rf .git/config.lock
git config --global user.email “name@gmail.com”
git config --global user.name “Name”

Now you can get back to your git remote add command

FAQ of Error: could not lock config file .git/config: File exists fatal: could not set

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.