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
brew update throws " couldn't find remote ref refs/heads/master"
this happens since flutter forward ➜ ~ brew update fatal: couldn't find remote ref refs/heads/master Error: Fetching /opt/homebrew/Library/Taps/dart-lang/homebrew-dart failed! Error: Some taps ... More on github.com
🌐 github.com
16
January 27, 2023
Failed `doom upgrade` - fatal: couldn't find remote ref refs/heads/master
I confirm that... I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved. I have read "How to Debug Issues", a... More on github.com
🌐 github.com
17
January 16, 2023
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
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) ...
🌐
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 ...
🌐
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 更新后
🌐
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
🌐
w3tutorials
w3tutorials.net › blog › fatal-couldn-t-find-remote-ref-refs-heads-master
Fix 'fatal: couldn't find remote ref refs/heads/master' Homebrew Installation Error: Step-by-Step Troubleshooting — w3tutorials.net
Why this works: The HEAD keyword dynamically points to the repository’s default branch (now main), avoiding hardcoded references to master. If the official script still fails, manually clone the Homebrew repository and specify the main branch: Remove残留文件: If a previous failed installation left residual files, delete them: ... Link Homebrew to your PATH: Add Homebrew’s binary directory to your shell’s PATH so you can run brew commands: echo 'export PATH="/usr/local/Homebrew/bin:$PATH"' >> ~/.bash_profile # For Bash # OR for Zsh (default on macOS Catalina+): echo 'export PATH="/usr/local/Homebrew/bin:$PATH"' >> ~/.zshrc
Find elsewhere
🌐
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 - Reset taps to point to the correct remote branches by running `brew tap --repair` ➜ ~ brew --version Homebrew 3.6.20 Homebrew/homebrew-core (git revision 482f2727196; last commit 2023-01-27) Homebrew/homebrew-cask (git revision c3e0e02345; last commit 2023-01-27) ➜ ~ dart --version Dart SDK version: 2.19.0 (stable) (Mon Jan 23 11:29:09 2023 -0800) on "macos_arm64" ➜ ~ flutter doctor -v [!] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-arm64, locale en-EE) • Flutter version 3.7.0 on channel stable at /Users/yakforward/fvm/versions/stable !
Author   dart-lang
🌐
GitHub
github.com › doomemacs › doomemacs › issues › 7041
Failed `doom upgrade` - fatal: couldn't find remote ref refs/heads/master · Issue #7041 · doomemacs/doomemacs
January 16, 2023 - > Updating packages (this may take a while)... x The package manager threw an error x Last 16 lines of straight's error log: [Return code: 0] $ cd /home/arun-mani-j/.config/emacs/.local/straight/repos/posframe/ $ git log --oneline --no-merges aa88860a16e28a311f81e18f1d9ed2e7d9e33991 \^aa88860a16e28a311f81e18f1d9ed2e7d9e33991 [Return code: 0] $ cd /home/arun-mani-j/.config/emacs/.local/straight/repos/transient/ $ git rev-parse HEAD 239be53b01e003c5206087d850d9672a42dc4b32 [Return code: 0] $ cd /home/arun-mani-j/.config/emacs/.local/straight/repos/transient/ $ git config --get remote.origin.url https://github.com/magit/transient.git [Return code: 0] $ cd /home/arun-mani-j/.config/emacs/.local/straight/repos/transient/ $ git fetch origin fatal: couldn't find remote ref refs/heads/master [Return code: 128] !
Author   doomemacs
🌐
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.
🌐
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.

🌐
Brainly
brainly.com › computers and technology › high school › error: couldn't find the remote reference 'master'.
[FREE] Error: Couldn't find the remote reference 'master'. - brainly.com
November 19, 2023 - If necessary, switch to an existing ... find remote ref master' in Git indicates that the 'master' branch cannot be found in the remote repository you are trying to access....
🌐
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.
🌐
Laracasts
laracasts.com › discuss › channels › code-review › fatal-couldnt-find-remote-ref-main
fatal: couldn't find remote ref main
[advancew@sjc02 zws_framework_2]$ git remote -v origin .git/ (fetch) origin .git/ (push) [advancew@sjc02 zws_framework_2]$ git pull origin main fatal: couldn't find remote ref main
🌐
Meta Jon
meta.jlericson.com › t › the-least-you-can-do › 244
The least you can do - Meta Jon
November 29, 2023 - I have a cronjob that updates Homebrew every night. Lately it’s been failing and I finally had a moment to dig in this morning. Here was the error: $ brew update -q fatal: couldn't find remote ref refs/heads/master Erro…
🌐
Baeldung
baeldung.com › home › git › git missing refs resulting in not something we can merge and did not match any file(s) known
Git Missing Refs Resulting in not something we can merge and did not match any file(s) known | Baeldung on Ops
July 6, 2024 - Critically, we only see the master ref. At this point, let’s create a new repository in another subdirectory and add ../remote/ as its origin as well:
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.

🌐
GitHub
github.com › Microsoft › vscode › issues › 62271
Git fatal could not find remote ref on macbook pro · Issue #62271 · microsoft/vscode
October 31, 2018 - You switched accounts on another tab or window. Reload to refresh your session. ... When i try to push my commits to the remote (azure devops) i get an error "Could not find remote ref 'nameofbranch'" The branch is not present on the remote, ...
Author   microsoft