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?
- How do I check out a remote Git branch?
- How do I delete a Git branch locally and remotely?
- How do I use ‘git reset –hard HEAD’ to revert to a previous commit? [duplicate]
- What is git tag, How to create tags & How to checkout git remote tag(s)
- Using prevNext Modx Addon
- :wq! command in vim
- How do I delete a Git branch locally and remotely?
- how to set the background color of the status bar during the launching phase [duplicate]
- api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft Office file [closed]
- How do I rename a local Git branch?
- When is K 1024 and when is it 1000?
- What is a MIME type?
- Logitech/LGHUB Lua – Loop with break
- What does ‘–set-upstream’ do?
- are there dictionaries in javascript like python?
- What does ‘–set-upstream’ do?
- How can I convert MP3 file to a Base64 encoded string? [closed]
- Understanding The Modulus Operator %
- Difference between “git add -A” and “git add .”
- Understanding the main method of python [duplicate]
- Dial pad to get phone number (with Android button images)
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- How is the AND/OR operator represented as in Regular Expressions?
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- error: src refspec master does not match any
- Istio Ingress resulting in “no healthy upstream”
- Why is it not possible to fake an IP address?
- How to open a “-” dashed filename using terminal?
- What does cherry-picking a commit with Git mean?
- Substring in excel
- How to cherry pick from 1 branch to another
- What is a LAMP stack?
- What is a sanity test/check
- What is the difference between POST and PUT in HTTP?
- How to Git stash pop specific stash in 1.8.3?
- What is the difference between POST and PUT in HTTP?
- How to use Git Revert
- How to find Google’s IP address?
- What exactly is a VBO in OpenGL?
- What and where are the stack and heap?
- ping response “Request timed out.” vs “Destination Host unreachable”
- Authentication versus Authorization
- How do I undo the most recent local commits in Git?
- What is a reverse shell?
- How does npm start work? What all processes are happening in the background?
- What is an instance variable in Java?
- What is the := operator?
- What is tail recursion?
- Discord music bot not working
- What does “:=” mean in Pseudocode? [closed]
- How do I revert a Git repository to a previous commit?
- Why am I getting error for apple-touch-icon-precomposed.png
- What is the best (and safest) way to merge a Git branch into master?
- How to merge branch to master?
- No results found on kibana -> discover
- Git: How do I force “git pull” to overwrite local files?
- Differences between git pull origin master & git pull origin/master
- How do I force git pull to overwrite everything on every pull?
- What is Xpenology? Is it Linux related thing?
- What happens when I do git pull origin master in the develop branch?
- Why do we need virtual functions in C++?
- Undo a Git merge that hasn’t been pushed yet
- How do I properly force a Git push?
- How do I rename a local Git branch?
- fatal: Not a git repository (or any of the parent directories): .git [duplicate]