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
"Couldn't find remote ref master"
Is the remote branch actually called "master"?
More on reddit.comversion control - Couldn't find remote ref HEAD in Git - Stack Overflow
fatal: coudn't find remote ref master
git pull displays "fatal: Couldn't find remote ref refs/heads/xxxx" and hangs up - Stack Overflow
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?
[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?
Those settings allow git to know what to push to or what to pull from:
push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows.
It should only be:
git config --global push.default current
(I am not aware of that setting for pull)
I would recommend:
- using the remote name instead of its url: origin
- using a push with makes a tracking connection between your local and upstream branch:
So:
git push -u origin master
git pull origin
After that, a simple git push will be enough: see "Why do I need to explicitly push a new branch?" for more.
I tried this after push.
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 ?
Really this is alone reason or ?
If someone figure it please give a reply..
There are probably some commands to resolve it, but I would start by looking in your .git/config file for references to that branch, and removing them.
You also have to delete the local branch:
git branch -d 6796
Another way is to prune all stale branches from your local repository. This will delete all local branches that already have been removed from the remote:
git remote prune origin --dry-run