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

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

Thank you for your help, but now i am facing an issue while push in git repository.
Fatal: ‘origin’ does not appear to be a git repository
Fatal: could not read from remote repository

Please help

What will be our user.email and user.name? How are we supposed to get it?

user.email is email that you provide in GitLab and use.name is your name in GitLab profile.