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:
Specify remote branch in pull/push commands every time (case sensitive):
git pull origin DownloadManageror
git pull origin downloadmanager:DownloadManager
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).
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 OverflowBe 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:
Specify remote branch in pull/push commands every time (case sensitive):
git pull origin DownloadManageror
git pull origin downloadmanager:DownloadManager
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).
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
This error happens because of local repository can't identify the remote branch at first time. So you need to do it first. It can be done using following commands:
git remote add origin 'url_of_your_github_project'
git push -u origin master
[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?
Fatal : couldn't find remote ref
Could not find remote ref #git fetch origin
Git Error when rebuilding app - couldn’t find remote ref refs/heads/tests-passed
fatal: coudn't find remote ref master
Why does Git show couldn't find remote ref master?
What causes the error 'fatal: couldn't find remote ref main' in Git?
Why does git pull origin main show couldn't find remote ref main?
Check the branch you are on (git branch), check the configuration for that branch (in .../.git/config), you probably are on the wrong branch or your configuration for it tells to merge with a (now?) non-existent remote branch.
In my case, my local branch was not set to track the remote branch. I had to manually run:
git pull origin remotebranch
Then next time you do a push do "git push -u" to set up correct tracking.
I couldn't find a way to remove this via the command line, so I just edited my Git config file at .git/config and removed this line:
fetch = refs/heads/2013.rel25:refs/remotes/origin/2013.rel25
One of way to deal with this problem is to clone the project from remote and you will have Clean files without any errors.