문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top