I’m not sure why this doesn’t work. When I do git branch -a, this is what I see:

I’m trying to pull from the DownloadManager on the online GitHub repository. I have tried
git pull, but then it complains about not knowing which branch to pull fromgit pull origin, doesn’t know which branchgit pull origin downloadmanagergivesfatal: Couldn't find remote ref downloadmanager. Unexpected end of commands streamgit pull origin remotes/origin/DownloadManagergivesfatal 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.
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:DownloadManagerSpecify 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):
and after any of those steps you can use easily:
git pullIf you use TortoiseGit:
RightClick on repo -> TortoiseGit -> Settings -> Git -> Edit local .git/config