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 Overflow[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?
Is the remote branch actually called "master"?
Have you created the repository on GitHub? It's seems you've created the local repo with git init but you need the remote repo created as well.
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
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
fatal: coudn't find remote ref master
Fatal : couldn't find remote ref
git pull displays "fatal: Couldn't find remote ref refs/heads/xxxx" and hangs up - Stack Overflow
Error in Bench update : fatal: couldn’t find remote ref master
How do I fix fatal couldn't find remote ref main?
Why does Git show couldn't find remote ref master?
What causes the error 'fatal: couldn't find remote ref main' in Git?
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
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.
This worked for me:
brew tap --repair
brew cleanup
brew update-reset
After that I was able to brew update without any issues.
Possible culprit:
dart-lang/dart: changed default branch name from master to main!
I had the same issue.
dart-lang seemed to be the culprit.
brew update-reset said that everything was up-to-date apart from:
==> Fetching /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart...
fatal: couldn't find remote ref refs/heads/master
error: Not a valid ref: refs/remotes/origin/main
brew tap --repair failed like so:
fatal: couldn't find remote ref refs/heads/master
Error: Failure while executing; `git -C /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart fetch origin` exited with 128.
Running brew doctor didn't show up anything pertinent, so some further digging was required.
Heading over to the dart-lang repo showed the very error as an issue & in the thread there, a solution:
https://github.com/dart-lang/homebrew-dart/issues/131#issuecomment-1411094620
So here's the code that Nakji wrote there:
cd /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart
git branch -m master main
git remote remove origin
git remote add origin https://github.com/dart-lang/homebrew-dart
Follow that up with the specific brew tap --repair dart-lang/dart which can then do its magic.
Brew is now able to update