Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Created September 19, 2023 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbietunnie/f7a9b4e053dc6824a093ff3713cde8e8 to your computer and use it in GitHub Desktop.
Save barbietunnie/f7a9b4e053dc6824a093ff3713cde8e8 to your computer and use it in GitHub Desktop.
How to resolve git error: `Unable to append to .git/logs/refs/remotes/origin/master: Permission denied`

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

It appears git was run locally as root, thus changing the ownership on some of the files tracking the location of the origin branch.

Fixing the file ownership should resolve the issue:

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

Reference: Stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment