example
[~]$ git fetch --all
Fetching origin
error: Unable to append to .git/logs/refs/remotes/origin/master: ????????
From github.com:
! aa04681..aab3be0 master -> origin/master (unable to update local ref)
error: Unable to append to .git/logs/refs/remotes/origin/branch2: ????????
! [new branch] branch2 -> branch2 (unable to update local ref)
error: Unable to append to .git/logs/refs/remotes/origin/branch3: ????????
! [new branch] branch3 -> origin/branch3 (unable to update local ref)
error: Unable to append to .git/logs/refs/remotes/origin/branch4: ????????
! [new branch] branch4 -> origin/branch4 (unable to update local ref)
error: Could not fetch origin
とfetchしてremote内のブランチを取得しようとしたところエラーが発生しました。
対処法を備忘録として残しておくとです。
method
考えうる原因は2つです
- .git が書き込み権限が付与されていない
- .git の管理者権限がrootとかになっている
R/W権限の問題は少しの間だけ sudo chmod 777 ./.git
にしてみるといいかも。
管理者権限は
sudo chown -Rc $UID .git/
にして .git 配下の管理者を変更したところ、正常にfetchできました。
参考になったリンク
- [git pullやgit fetchをしようとしたらエラーが出るとき] (https://qiita.com/naga1460/items/aa55bbf36a356bd08383)
- Git commit problem: Unable to append to .git/