Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull fails "unable to resolve reference" "unable to update local ref"

Tags:

git

git-pull

Using git 1.6.4.2, when I tried a git pull I get this error:

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) 

I've tried git remote prune origin, but it didn't help.

like image 876
Gabrielle Avatar asked Jun 08 '10 15:06

Gabrielle


People also ask

How do I fix unable to update local ref?

If I have a file open in a Mac app from a repo that's located on the Windows VM, I sometimes get the "unable to update local ref" error. The solution when this happens is to simply close the file or quit the Mac app. This is exactly what my situation was.

How do I fix broken references in git?

Solution. Unsure the root cause of the "reference broken". To fix it, delete this file . git/refs/remotes/origin/master , and git fetch to retrieve it back.

Can not lock ref git pull?

git directory to ensure that no other Git process takes place during the operation. "error: cannot lock ref" simply means information in /refs are corrupted and Git cannot continue to create index. lock file.

What git fetch does?

Git fetch summary In review, git fetch is a primary command used to download contents from a remote repository. git fetch is used in conjunction with git remote , git branch , git checkout , and git reset to update a local repository to the state of a remote.


1 Answers

Try cleaning-up your local repository with:

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

man 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. 

man 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>".             
like image 114
Vojtech Vitek Avatar answered Sep 25 '22 09:09

Vojtech Vitek