My team and I ran into this error, unable to update local ref, when doing a pull in SourceTree.
Update 2020: Per @Edward Yang’s answer below, @bryan’s comment on this answer, and this question/answer you may need to run both
git gc --prune=now
andgit remote prune origin
. Running only the former has always worked for me but based on ppl’s responses I think both are necessary to address different causes of the error.
We used:
git gc --prune=now
This removes any duplicate reference objects which should fix the issue.
Here are a few links where you can learn more about git references and pruning :
Related Posts:
- Handling file renames in Git
- Why are there two ways to unstage a file in Git?
- ‘git’ is not recognized as an internal or external command
- ‘git’ is not recognized as an internal or external command
- How to remove origin from git repository
- What’s the purpose of git-mv?
- git : Pull is not possible because you have unmerged files
- Why git asks to enter a commit message to explain why this merge is necessary
- How do I remove version tracking from a project cloned from git?
- How do I remove version tracking from a project cloned from git?
- git pull on a different branch
- Download a specific tag with Git
- Git push won’t do anything (everything up-to-date)
- git add . -> still “nothing to commit” with new files
- git submodule add error: does not have a commit checked out
- git status shows modifications, git checkout —
doesn’t remove them - How to resolve git’s “not something we can merge” error
- How to clone all remote branches in Git
- Update Git branches from master
- How to squash all git commits into one?
- How to interactively (visually) resolve conflicts in SourceTree / git
- How can I delete all of my Git stashes at once?
- git add only modified changes and ignore untracked files
- Remove node_modules from git in vscode
- What’s the use of the staging area in Git?
- git push –force-with-lease vs. –force
- How can I move a tag on a git branch to a different commit?
- Run Oracle SQL script and exit from sqlplus.exe via command prompt
- Show full process name in top
- What firewall ports need to be open to allow access to external git repositories?
- How to zip/unzip files in Powershell?
- How do I prevent apache from serving the .git directory?
- How can I get diff to show only added and deleted lines? If diff can’t do it, what tool can?
- Istio Ingress resulting in “no healthy upstream”
- What is a LAMP stack?
- What is the difference between POST and PUT in HTTP?
- How to use Git Revert
- What and where are the stack and heap?
- What is a reverse shell?
- Why am I getting error for apple-touch-icon-precomposed.png
- How do I properly force a Git push?
- How to remove local (untracked) files from the current Git working tree
- How could I ping @here in Discord.py?
- How to modify existing, unpushed commit messages?
- ssh remote host identification has changed
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How to link to part of the same document in Markdown?
- How do I rename both a Git local and remote branch name?
- Configuring so that pip install can work from github
- How to UPSERT (MERGE, INSERT … ON DUPLICATE UPDATE) in PostgreSQL?
- What is the difference between allFile and allMarkdownRemark in gatsby
- Can I share my private GitHub repository by link?
- DynamoDB : The provided key element does not match the schema
- How do I run a single test using Jest?
- Why I am getting java.lang.AbstractMethodError errors?
- PHP &$string – What does this mean?
- git: fatal: Could not read from remote repository
- Default location of freepbx backup?
- “Unable to find remote helper for ‘https'” during git clone
- Why does Git tell me “No such remote ‘origin'” when I try to push to origin?
- ORA-01461: can bind a LONG value only for insert into a LONG column-Occurs when querying
- The specified DSN contains an architecture mismatch between the Driver and Application. JAVA
- Python FileNotFound
- Unity Collaborate vs GitHub
- What is the difference between clang (and LLVM) and gcc / g++?
- Simplest way to profile a PHP script
- How to change the license for a project at Github?
- bit vectors in c++
- ++someVariable vs. someVariable++ in JavaScript
- How to increase size of DOSBox window?
- How can I run a program from a batch file without leaving the console open after the program starts?
- How to keep a branch synchronized/updated with master?
- What is the difference between “JPG” / “JPEG” / “PNG” / “BMP” / “GIF” / “TIFF” Image?
- Specify an SSH key for git push for a given domain
- Get a list of URLs from a site
- How do I “un-revert” a reverted Git commit?
- How to get parameter value from query string?
- git push not send changes to remote git repository
- How to use Git and Dropbox together?
- Difference between Chocolatey and NuGet
- Regex multiple match substring
- Git: Where exactly is the “working directory”?
- What exactly does the “u” do? “git push -u origin master” vs “git push origin master”
- git and local wordpress: how to handle wordpress updates?
- How to make a redirection that fired a script before redirecting?
- Create post and update in the same flow [closed]
- SymmetricDS in dev + prod workflow?
- Plugin updated pushed with git break site
- How to make a copy of a local wordpress build in MAMP?
- Useful Command-line Commands on Windows
- Any benefit or detriment from removing a pagefile on an 8 GB RAM machine?
- How do I view the details of a digital certificate .cer file?
- Resolve host name from IP address
- How do you validate fstab without rebooting?
- DNS – NSLOOKUP what is the meaning of the non-authoritative answer?
- Run a .bat file in a scheduled task without a window
- Why can’t a CNAME record be used at the apex (aka root) of a domain?
- How can I upgrade to Java 1.8 on an Amazon Linux Server?
- What port should I open to allow remote desktop?
- Can you help me with my capacity planning?