Frage

I've modified my .gitignore file from my VPS. Then I've commit the change and pushed to remote repo:

git add .gitignore
git commit -m ".gitignore changed"
git push -u origin --all

and then, I pull it to localhost:

git pull

But I get the next error:

error: unable to unlink old '.gitignore' (Permission denied)

I've tried changing permissions of .gitignore local file to 0777, but doesn't work. The file in remote repo has been changed, but not in my local file What could be the problem? and how could be solved?

War es hilfreich?

Lösung

The answer was easy:

sudo git pull

Edit:

I had probably wrong permissions (better said, owner) in the .git directory. It's better to change the owner of this directory and files instead:

sudo chown -R yourGitUser ./.git

Andere Tipps

Seems like a permission problem. Try applying 0775 rights to the .git folder, not only .gitignore.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top