0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

git fetch ができなかった時の対処法

Last updated at Posted at 2020-07-16

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つです

  1. .git が書き込み権限が付与されていない
  2. .git の管理者権限がrootとかになっている

R/W権限の問題は少しの間だけ sudo chmod 777 ./.git にしてみるといいかも。

管理者権限は

sudo chown -Rc $UID .git/

にして .git 配下の管理者を変更したところ、正常にfetchできました。

参考になったリンク

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?