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
🌐
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.
Discussions

"Couldn't find remote ref master"

Is the remote branch actually called "master"?

More on reddit.com
🌐 r/git
23
12
January 6, 2021
version control - Couldn't find remote ref HEAD in Git - Stack Overflow
git config --global pull.default current git config --global push.default current · I tried this command after i made pull.. Then when i pushed it it works.. Still i need to know the scene behind this ? ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... Live from re:Invent…it’s Stack Overflow! ... 1 Error: warning: remote HEAD refers ... More on stackoverflow.com
🌐 stackoverflow.com
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
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 other machine (git push :6796). Now, when I run git pull: fatal: Couldn't find remote ref ... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

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) ...
Why does git pull origin main show couldn't find remote ref main?
This usually happens when the remote repository does not contain a branch named main. Many older repositories still use the master branch as the default branch. Running `git branch -r` will show which branches actually exist on the remote repository.
🌐
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) ...
🌐
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 ... [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
🌐
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 - 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. The branch name in Git is case sensitive.
Find elsewhere
🌐
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?

🌐
Tabby Data
tabbydata.com › home › why does the error fatal: couldn’t find remote ref occur and how can i fix it?
Why Does the Error Fatal: Couldn't Find Remote Ref Occur and How Can I Fix It?
December 24, 2025 - By applying these practices, developers ... error message `Fatal: Couldn’T Find Remote Ref` typically occurs when Git attempts to access a reference (such as a branch, tag, or commit) on a remote repository but fails to locate it....
🌐
Saywebsolutions
saywebsolutions.com › blog › git-github-error-fatal-couldnt-find-remote-ref-master
Git Error | Say Web Solutions
October 8, 2020 - # Switch to "master" branch git checkout master # Rename "master" branch to "main" git branch -m master main # Get latest commits and branches from remote git fetch # Remove existing connection with "master" git branch --unset-upstream # Create connection with new "main" branch git branch -u origin/main
🌐
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 - Of course, there’s currently no remote origin branch called branch1, so we see the error fatal: couldn’t find remote ref. We can verify that a branch doesn’t exist locally as well by trying a checkout on it: $ git checkout branch2 error: pathspec 'branch2' did not match any file(s) known to git · The did not match any file(s) known to git error is common when we attempt to use unknown object names. To get branch1 and other branches, we need to push all of them from the original repository:
🌐
tutorialpedia
tutorialpedia.org › blog › git-pull-remote-branch-cannot-find-remote-ref
Git Pull Error: How to Fix 'Cannot Find Remote Ref' When Pulling a Remote Branch — tutorialpedia.org
Via the command line: Use git ls-remote to list all refs on the remote: git ls-remote origin | grep [branch-name] # Replace origin and [branch-name] If no results appear, the branch does not exist on the remote.
🌐
Araqev
araqev.com › home › why am i seeing ‘fatal: couldn’t find remote ref’? understanding this common git error
Why Am I Seeing 'fatal: couldn't find remote ref'? Understanding This Common Git Error
April 13, 2025 - Local Repository State: The local repository may not be up to date with the remote, leading to discrepancies. To resolve the “fatal: couldn’t find remote ref” error, follow these troubleshooting steps: Verify Remote Configuration: Check the remote URL with: “`bash git remote -v “` ...
🌐
DevErrors
deverrors.com › home › git › fatal: couldn't find remote ref
Deverrors
May 28, 2026 - Some Git hosting platforms allow ... find remote ref refs/heads/branch-name" error indicates that Git attempted to fetch or checkout a branch from the remote repository, but that branch does not exist there....
🌐
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
🌐
HatchJS
hatchjs.com › home › git fatal: could not find remote ref – how to fix it
Git fatal: could not find remote ref - How to fix it
January 5, 2024 - There are a few different ways to fix a git fatal couldn’t find remote ref error. The best way to fix the error depends on the cause of the error. ... If the remote repository does not exist, you will need to create it before you can push or pull from it.
🌐
Devgex
devgex.com › en › article › 00004267
Resolving 'Couldn't Find Remote Ref' Errors in Git Branch Operations: Case Study and Solutions - DevGex
November 4, 2025 - Abstract: This paper provides an in-depth analysis of the common 'fatal: Couldn't find remote ref' error in Git operations, identifying case sensitivity mismatches between local and remote branch names as the root cause. Through detailed case studies, we present three comprehensive solutions: explicit remote branch specification, upstream tracking configuration, and manual Git configuration editing.
🌐
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 - Unable to view the Diff and Commits tab in a Pull request because merge between a branch in forked repository and branch in Main repository gives error Couldn't find remote ref <ref> ... DEBUG [http-nio-7990-exec-7] <username> @1Q1D2K7x626x1237485x0 jdsoxe 10.0.16.128,127.0.0.1 "GET /rest/api/latest/projects/<PROJECT-KEY>/repos/<repo-slug>/pull-requests/<ID>/changes HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 500 com.atlassian.bitbucket.scm.CommandFailedException: '/usr/local/bin/git fetch /var/atlassian/application-data/stash/shared/data/repositories/1820 <branch-ref>:' exited with code 128 saying: fatal: Couldn't find remote ref <branch-ref> fatal: The remote end hung up unexpectedly at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onError(DefaultCommandExitHandler.java:47) at java.lang.Thread.run(Thread.java:748) ...
🌐
GitHub
github.com › akonwi › git-plus › issues › 618
"fatal: Couldn't find remote ref feature" on pull · Issue #618 · akonwi/git-plus
February 7, 2017 - When pulling from a coworker's remote branch which I've already checked out, I'm seeing "fatal: Couldn't find remote ref feature". This does not occur when running git pull normally in the command line. Steps to reproduce: --Checkout thi...
Author   akonwi