tech::hexagram

personal note for technical issue.

git fetchで、unable to update local refとエラーが出た場合の対処法

リモートでブランチが削除されたのか、git fetchしようとした時にエラーが出た。 git remote prune origin / git fetch originで解決。

error: there are still refs under 'refs/remotes/origin/XXX`
 ! [new branch]      XXX    -> origin/XXX  (unable to update local ref)
$ git remote prune origin
...

$ git fetch origin
From github.com:xxx/xxx
 * [new branch]      XXX    -> origin/XXX