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 the following commands in a 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