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
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
github - git pull master with error: fatal: couldn't find remote ref master - Stack Overflow
When running the git pull command to pull master: $ git pull ds master (Note: ds is the remote repo's alias.) it pops up the following error: fatal: couldn't find remote ref master But as running... More on stackoverflow.com
🌐 stackoverflow.com
Git Fatal : Couldn't Find Remote Ref Master
If you take two seconds to read, you're trying to push a file that's too large. You shouldn't be pushing that folder of packages anyway. More on reddit.com
🌐 r/github
17
0
December 9, 2023
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 - The Git error "fatal: couldn't find remote ref" occurs when Git cannot locate the specified branch on the remote repository. This typically happens when the branch name is incorrect, the branch does not exist on the remote server, or the 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 ...
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
Top answer
1 of 1
7

The problem in this case is that your remote ds does not have a branch named master. Probably they've switched to using main instead, but perhaps they just don't have either one. Note that there is nothing special about either name, except that people tend to use those as the initial name of the first branch they create. Any branch can be renamed at any time: the names are not significant.

Note that in Git, a branch name merely holds the hash ID of the last commit that Git should consider to be part of the branch. The two constraints on branch names are:

  • they must meet the requirements spelled out in the git check-ref-format documentation;
  • they must contain the hash ID of some existing commit.

This means that in a new, empty Git repository, with no commits in it, no branch names exist. Nonetheless, you are, in such a repository, "on" some branch. You're just on a branch that doesn't exist. Making the first commit creates the branch with that name—so until you make the first commit, you can change the name as much as you like: you're changing the name of the branch that doesn't exist.

Yesterday, upon the stair,
I met a man who wasn't there!
He wasn't there again today.
Oh how I wish he'd go away!
—William Hughes Mearns

Once you've created your first commit, your initial branch name now exists. You may now rename it, and/or create as many more branch names as you like, though all must select this same commit. As you add more commits to the repository, you can make the various branch names point to different commits, and/or add new branch names. The existing commits remain, and are findable—or not findable—by starting from some named commit and working backwards.

🌐
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 ·
🌐
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 - So basically the developers fork ... own master in the main project. 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 ...
🌐
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.
🌐
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.

🌐
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.
🌐
GitHub
github.com › facebookresearch › Mephisto › issues › 541
Master is missing! fatal: couldn't find remote ref master · Issue #541 · facebookresearch/Mephisto
September 1, 2021 - git branch -m master main git fetch origin git branch -u origin/main main git remote set-head origin -a
Author   facebookresearch
🌐
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
🌐
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.
🌐
GitHub
github.com › dart-lang › homebrew-dart › issues › 131
brew update throws " couldn't find remote ref refs/heads/master" · Issue #131 · dart-lang/homebrew-dart
January 27, 2023 - ➜ ~ brew update fatal: couldn't ... taps can not read their remote branches: dart-lang/dart This is happening because the remote branch was renamed or deleted....
Author   dart-lang
🌐
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 - When running tldr -u command, the following error is displayed: ❯ 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/.local/share/tldr/tldr If you cd to the directory mentioned in the error and run the command modifying "master" to "main" it works: ❯ git pull origin main From https://github.com/tldr-pages/tldr * branch main -> FETCH_HEAD Already up to date.
🌐
Ubuntu
bugs.launchpad.net › bugs › 2018387
Bug #2018387 “couldn't find remote ref master” : Bugs : haskell-tldr package : Ubuntu
May 3, 2023 - I am using tldr 0.6.4-1build6.3 on Linux Mint 21 and I get this error when running "tldr --update": fatal: couldn't find remote ref master tldr: Received ExitFailure 1 when running Raw command: git pull origin master Run from: /home/pierre/.local/share/tldr/tldr The master branch has been replaced by main: https://github.com/tldr-pages/tldr/issues/9628
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[SOLVED] "fatal: Couldn't find remote ref HEAD" / AUR Issues, Discussion & PKGBUILD Requests / Arch Linux Forums
December 5, 2019 - aur.archlinux.org/daemon-engine.git is an empty repository, which is why it can't find remote ref master.