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
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
fatal: Couldn't find remote ref refs/heads/master
Full error: fatal: Couldn't find remote ref refs/heads/master fatal: The remote end hung up unexpectedly� I initialize a repository using: repo init -u git@gitlab.mycompany.com:manifests/releas... More on github.com
🌐 github.com
11
March 31, 2016
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
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) ...
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) ...
🌐
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.
🌐
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 ...
🌐
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
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.

Find elsewhere
🌐
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
🌐
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
🌐
GitHub
github.com › esrlabs › git-repo › issues › 33
fatal: Couldn't find remote ref refs/heads/master · Issue #33 · esrlabs/git-repo
March 31, 2016 - Since I use Jenkins in my build environment, if I don't wipe the workspace, the same commands as above are executed, however the 'repo sync' command throws the fatal error. This does not happen on linux using google's repo tool (with or without jenkins, it was manifested in jenkins). In examining the trace log on windows I find this: : git fetch --quiet origin --no-tags +refs/heads/master:refs/remotes/origin/master 1>| 2>|�
Author   esrlabs
🌐
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.

🌐
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
🌐
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 - /usr/local/bin/git fetch ... refs/heads/bug/ARGUS-23284 fatal: The remote end hung up unexpectedly · This can happen when are using a fork-merge like workflow for your development project, so all your developers always have an up-to-date master in their own fork and ...
🌐
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.
🌐
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.
🌐
Grav Community Forum
discourse.getgrav.org › support › plugins
Git Sync - fatal: Couldn't find remote ref master - Plugins - Grav Community Forum
January 12, 2020 - When saving at the end of the git sync wizard process, I receive: fatal: Couldn’t find remote ref master I think this is due to an earlier attempt at setting up a repo, and now attempting to make a change to the info referenced in the git sync plugin, but I’m not sure how to mo...
🌐
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 › actions › checkout › issues › 36
[error]fatal couldn't find remote ref · Issue #36 · actions/checkout
September 10, 2019 - I'm having issues when using actions/checkout. When it runs, I get ##[error]fatal: couldn't find remote ref refs/pull/217/merge The line can (and full log) can be found here. The action its...
Author   actions
🌐
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 - The error 'fatal: couldn't find remote ref master' indicates that Git cannot find the 'master' branch in the remote repository. To fix this, check if the branch exists, see if it has been renamed or deleted, and verify your permissions.