git pull が失敗します。「参照を解決できません」「ローカル参照を更新できません」質問する

git pull が失敗します。「参照を解決できません」「ローカル参照を更新できません」質問する

git 1.6.4.2 を使用して、git pull次のエラーが発生する場合がありました:

error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory
From git+ssh://remoteserver/~/misk5
 ! [new branch]      LT558-optimize-sql -> origin/LT558-optimize-sql  (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory
 ! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

試してみましたgit remote prune originが、効果はありませんでした。

ベストアンサー1

次のコマンドでローカル リポジトリをクリーンアップしてみてください。

$ git gc --prune=now
$ git remote prune origin

git-gc(1) を実行します:

git-gc - Cleanup unnecessary files and optimize the local repository

git gc [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune]

       Runs a number of housekeeping tasks within the current repository, such as compressing file revisions
       (to reduce disk space and increase performance) and removing unreachable objects which may have been
       created from prior invocations of git add.

       Users are encouraged to run this task on a regular basis within each repository to maintain good disk
       space utilization and good operating performance.

git-remote(1) を実行します:

git-remote - manage set of tracked repositories

git remote prune [-n | --dry-run] <name>

           Deletes all stale remote-tracking branches under <name>. These stale branches have already been
           removed from the remote repository referenced by <name>, but are still locally available in
           "remotes/<name>".            

おすすめ記事