Be careful - you have case mixing between local and remote branch!

Suppose you are in local branch downloadmanager now (git checkout downloadmanager)

You have next options:

  1. Specify remote branch in pull/push commands every time (case sensitive):

    git pull origin DownloadManager

    or

    git pull origin downloadmanager:DownloadManager


  1. Specify tracking branch on next push:

    git push -u origin DownloadManager

    (-u is a short form of --set-upstream)

    this will persist downloadmanager:DownloadManager link in config automatically (same result, as the next step).


  1. Set in git config default remote tracking branch:

    git branch -u downloadmanager origin/DownloadManager

    (note, since git 1.8 for branch command -u is a short form of --set-upstream-to, which is a bit different from deprecated --set-upstream)

    or edit config manually (I prefer this way):

    git config --local -e

    -> This will open editor. Add block below (guess, after "master" block):

    [branch "downloadmanager"]
            remote = origin
            merge = refs/heads/DownloadManager
    

and after any of those steps you can use easily:

git pull

If you use TortoiseGit: RightClick on repo -> TortoiseGit -> Settings -> Git -> Edit local .git/config

Answer from radistao on Stack Overflow
🌐
Reddit
reddit.com › r/git › "couldn't find remote ref master"
r/git on Reddit: "Couldn't find remote ref master"
January 6, 2021 -

[SOLVED]

Well, it's my first time dealing with this "Git interface". After using commands like:

"git init"

"git remote add origin [link of my repository on Github with that ".git" after its link]"

I tried to make that "pull" command:

"git pull origin master"

however, it's probably not working due to this warning thrown by the terminal:

"fatal: couldn't find remote ref master"

Why is this error happening? How should I fix it?

Discussions

fatal: coudn't find remote ref master
Having trouble pulling updates from master? (fatal: coudn't find remote ref master) Try the following to fix your remote/upstream references: git pull origin git checkout -b main git branch mai... More on github.com
🌐 github.com
3
July 22, 2020
Fatal : couldn't find remote ref
Select Topic Area Question Body Could day I am a bit stuck and after googling for hours I thought its time to put up my hand and call for help ... I forked an upstream repo Created a PR-branch to a... More on github.com
🌐 github.com
5
1
March 1, 2026
git pull displays "fatal: Couldn't find remote ref refs/heads/xxxx" and hangs up - Stack Overflow
I created a branch called 6796, then I pushed it to remote, checked it out on another machine, made other edits, pushed it, then merged it with master, and deleted it locally and remotely on the ot... More on stackoverflow.com
🌐 stackoverflow.com
Error in Bench update : fatal: couldn’t find remote ref master
pls help guys, getting the following error fatal: couldn’t find remote ref master ERROR: with bench update --reset i do have custom apps… if i delete all custom apps from the apps folder n just keep frappe n erpnext apps… the bench update goes through fine… logs: HEAD is now at 29bb873347 ... More on discuss.frappe.io
🌐 discuss.frappe.io
0
0
December 23, 2022
People also ask

How do I fix fatal couldn't find remote ref main?
First verify that the branch exists on the remote repository using `git branch -r` or `git ls-remote --heads origin`. If the repository still uses the master branch, update your command to use master instead of main. You may also need to fetch updated references using `git fetch --all`.
🌐
golinuxcloud.com
golinuxcloud.com › home › devops › git › git fix: fatal: couldn't find remote ref main (complete guide)
Git Fix: fatal: couldn't find remote ref main (Complete Guide) ...
Why does Git show couldn't find remote ref master?
Many repositories have migrated from master to main as the default branch. If the repository uses main instead of master, attempting to pull master will result in this error. Updating the command to use the correct branch resolves the issue.
🌐
golinuxcloud.com
golinuxcloud.com › home › devops › git › git fix: fatal: couldn't find remote ref main (complete guide)
Git Fix: fatal: couldn't find remote ref main (Complete Guide) ...
What causes the error 'fatal: couldn't find remote ref main' in Git?
This error occurs when Git cannot locate the specified branch on the remote repository. It typically happens when the branch does not exist, the repository still uses the master branch instead of main, or when the local repository references an incorrect or outdated remote branch.
🌐
golinuxcloud.com
golinuxcloud.com › home › devops › git › git fix: fatal: couldn't find remote ref main (complete guide)
Git Fix: fatal: couldn't find remote ref main (Complete Guide) ...
🌐
GoLinuxCloud
golinuxcloud.com › home › devops › git › git fix: fatal: couldn't find remote ref main (complete guide)
Git Fix: fatal: couldn't find remote ref main (Complete Guide) | GoLinuxCloud
March 15, 2026 - Updating the pipeline configuration to use the correct branch usually resolves the issue. The Git error "fatal: couldn't find remote ref" occurs when Git cannot locate the specified branch on the remote repository.
🌐
GitHub
github.com › openshift-evangelists › kbe › issues › 55
fatal: coudn't find remote ref master · Issue #55 · openshift-evangelists/kbe
July 22, 2020 - Having trouble pulling updates from master? (fatal: coudn't find remote ref master) Try the following to fix your remote/upstream references: git pull origin · git checkout -b main · git branch main -u origin/main · git remote set-head origin main · git branch --set-upstream-to=origin/main main ·
Author   openshift-evangelists
🌐
Saywebsolutions
saywebsolutions.com › blog › git-github-error-fatal-couldnt-find-remote-ref-master
Git Error | Say Web Solutions
October 8, 2020 - fatal: Couldn't find remote ref master · it's probably because you have tried to use the old racist command: git pull origin master · The default git branch name master has recently been found to be racist, so it's been changed to default to main instead. So instead of pulling from the master ...
Find elsewhere
🌐
Laracasts
laracasts.com › discuss › channels › code-review › fatal-couldnt-find-remote-ref-main
fatal: couldn't find remote ref main
Can't understand this error message: fatal: couldn't find remote ref main · Nakov · 4 years ago · Level 73 · ReplyReport Spam · So probably the branch is not called main but something else, master maybe? git pull origin master · Like Reply · davy_yg · OP ·
🌐
YouTube
youtube.com › sagar s
fatal couldn't find remote ref master main - Error in git - git subtree - pull or fetch error - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera - http://amzn.to/2tVwcMPTripod - http://a...
Published   April 1, 2022
Views   18K
🌐
Frappe
discuss.frappe.io › erpnext
Error in Bench update : fatal: couldn’t find remote ref master - ERPNext - Frappe Forum
December 23, 2022 - pls help guys, getting the following error fatal: couldn’t find remote ref master ERROR: with bench update --reset i do have custom apps… if i delete all custom apps from the apps folder n just keep frappe n erpnext apps… the bench update goes through fine… logs: HEAD is now at 29bb873347 chore(release): Bumped to Version 14.11.0 $ git reflog expire --all $ git gc --prune=all Enumerating objects: 489793, done.
🌐
Atlassian Support
support.atlassian.com › bitbucket-data-center › kb › couldnt-find-remote-ref-error-in-bitbucket
"Couldn't find remote ref" error in Bitbucket | Bitbucket Data Center | Atlassian Support
April 24, 2025 - These errors occur generally when you try to merge changes from a forked repository to the main repository and check the box for "Deleting the source branch", while merging. The missing ref would be the branch you're merging from. Following are the steps to follow where you can see these errors: ...
🌐
GitHub
github.com › facebookresearch › Mephisto › issues › 541
Master is missing! fatal: couldn't find remote ref master · Issue #541 · facebookresearch/Mephisto
September 1, 2021 - Master is missing! fatal: couldn't find remote ref master#541 · Copy link · Labels · announcement · JackUrb · opened · on Sep 1, 2021 · Issue body actions · We've updated the main branch of Mephisto to main in #537, and as such those who were accessing Mephisto off of the master branch will need to run the following to track the new branch: git branch -m master main git fetch origin git branch -u origin/main main git remote set-head origin -a ·
Author   facebookresearch
🌐
Buildkite
forum.buildkite.community › general
Fatal: couldn't find remote ref master - General - Buildkite Community Forum
March 23, 2023 - Hi, I tried to setup a buildkite plan for my repo in github. When I run a new build , I see this error: git fetch -v --prune – origin master POST git-upload-pack (317 bytes) fatal: couldn’t find remote ref master ⚠ Warning: Checkout failed! exit status 128 (Attempt 3/3) 🚨 Error: exit status 128 Not sure why I am getting this error.
🌐
piaohua's blog
piaohua.github.io › post › tool › 20231022-brew-update-fail
fatal: couldn't find remote ref refs/heads/master - piaohua's blog
October 22, 2023 - fatal: couldn’t find remote ref refs/heads/master brew 更新提示失败如下: 1 2 3 4 5 > brew update Warning: No available formula with the name "ca-certificates". ==> Searching for similarly named formulae and casks... Error: No formulae or casks found for ca-certificates. fatal: Couldn't find remote ref refs/heads/master 解决方法: 1 /usr/local/Homebrew/Library/Taps/homebrew git:(master) > git pull origin master 更新后
🌐
Ubuntu
bugs.launchpad.net › bugs › 2067175
Bug #2067175 “tldr -u fail to update because the git master bran...” : Bugs : haskell-tldr package : Ubuntu
May 25, 2024 - ❯ tldr -u fatal: couldn't find remote ref master tldr: Received ExitFailure 1 when running Raw command: git pull origin master Run from: /home/fellipec/ ... If you cd to the directory mentioned in the error and run the command modifying "master" to "main" it works:
🌐
Reddit
reddit.com › r/github › git fatal : couldn't find remote ref master
r/github on Reddit: Git Fatal : Couldn't Find Remote Ref Master
December 9, 2023 -

Hello

As I Trying To Upload The Files which Are Present In My Local Machine To Git Hub Repository.The Above Error Was Showing And I Tried To Use " git push origin master -- force" It's Not Working. Any Suggestions.....??

The Files I Am Trying To upload are Belongs To Project which I had done in my final semester.

Required Components For The project To work are :

Python 3.7🐍 and Various Libraries

I Have Only Tried To Complie this Project in My Local Machine But I Want To shift My Entire Project To Work In My Git Repo.So I Created a repo exclusive for my project and the thing is it contains various libraries to work so I tried to upload the site packages and script to my git repo but it's not working.

Care To Give any suggestions.

🌐
JanBask Training
janbasktraining.com › community › data-science › git-pull-fatal-couldnt-find-remote-ref-master
git pull-fatal: couldn\'t find remote ref master | JanBask Training Community
July 14, 2021 - git pull origin remotes/origin/DownloadManager 'fatal couldn't find remote ref remotes/origin/DownloadManager. Unexpected end of commands stream · Is there something I'm missing? In Xcode, When I try to connect to the repository, nothing ever shows up. I have been able to push to it in the past. But I can't push again until I pull the most recent changes. ... To solve couldn't find a remote ref master you should follow the below mentioned code.
🌐
Rust Programming Language
users.rust-lang.org › help
Cargo "couldn't find remote ref refs/heads/master" - help - The Rust Programming Language Forum
March 29, 2021 - I have a GitHub dependency which uses main as the default branch. When attempting to use this dependency by specifying a commit hash, cargo will fail to fetch. native-utils = { git = "ssh://git@github.com/edgeandnode/na…
🌐
Gridgrab
gridgrab.com › home › technology › fatal: couldn't find remote ref master
Fatal: Couldn't Find Remote Ref Master — Gridgrab
August 12, 2025 - Instead of a successful upload, Git spits back a blunt error message: Fatal: Couldn't Find Remote Ref Master. It feels like the digital equivalent of a "File Not Found" sign taped to a locked door. This specific error usually happens because you’re trying to pull from or push to a branch that doesn’t exist on the server, or perhaps the server itself is empty. We’ve seen this surge in frequency since major platforms like GitHub changed their default branch naming conventions from "master" to "main" back in 2020.