Git error: Unable to append to .git/logs/refs/remotes/origin/master: Permission denied

后端 未结 6 809
野性不改
野性不改 2020-12-22 20:28

I am having a strange issue that I can\'t seem to resolve. Here is what happend:

I had some log files in a github repository that I didn\'t want there. I found this

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 21:06

    This looks like you ran git as root locally, thus changing ownership on some of the files tracking the location of the origin branch.

    Fix the file ownership, and you should be fine:

    # run this from the root of the git working tree
    sudo chown -R "${USER:-$(id -un)}" .
    

提交回复
热议问题