Cannot fetch branch from remote.
See original GitHub issueDescription
I’ve reported this before, and it still is a problem. If I have branches on the origin that do not exist on my computer, I can’t find a way of adding these branches to my local repository without having to move to the command line. Which is something I don’t mind, but like to avoid anyway as our master students have the tendency to screw up royally when they touch the command line.
Version
GitHub Desktop version: 0.8.0
OS version: Windows 10
Steps to Reproduce
- Create a new branch locally
- Click on “Publish”
- Delete branch locally but not on the remote
- click “Fetch origin”
- click “Repository > Pull”
- close and open Github desktop again
- Repeat to check whether it will work this time
- Give up on Github desktop and go to command line
- git checkout --track origin/TheBranch
- pass computers of 2 colleagues and 3 students to check whether they found the command line and did this correctly
- realize one of them didn’t
- spend the next 15 minutes restoring what they broke
- report yet again and hope that this time a developer will be as kind as to implement something that avoids this ongoing frustration.
Expected behavior: I expected that fetch origin would also fetch branches on the remote and create them locally if they didn’t exist. Because one time in history, Github Desktop actually worked like that
Actual behavior: command line. Command line happened.
Reproduces how often: 100%
Logs
Additional Information
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
fetch in git doesn't get all branches
The problem can be seen when checking the remote.origin.fetch setting (The lines starting with $ are bash prompts with the commands I typed....
Read more >Git Fetch Doesn't Fetch All Branches - Randula Koralage
Even though you have pushed changes to your remote repository regarding other branches, the git fetch command doesn't update them locally.
Read more >Why Can't Git Fetch Remote Branches Other Than Master?
Last week I came into a problem with Git, that I can't fetch the remote branch that I just pushed to. It was...
Read more >Git Fetch | Atlassian Git Tutorial
To view your remote branches, simply pass the -r flag to the git branch command. You can inspect remote branches with the usual...
Read more >Workarounds to Git worktree using bare repository and cannot ...
That basically means that when you try to git fetch from your remote (e.g origin ), the remote branches are not downloaded. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JoFAM @iAmWillShepherd
The classic apps (both on macOS and Windows) do not distinguish between remote and local branches in the branch selector.
EDIT: I should make this clear here - the classic apps would remove remote information in the branch list to give the illusion the branch was created locally. The underlying Git behaviour is the same as what we’re doing in the Electron app - it’s just a visual change.
While this might make sense for common scenarios, it falls over in other places:
With the Electron version, we wanted to make this relationship more clear by:
This also doesn’t include new behaviour in Git itself when checking out an unknown branch - if the name of the branch matches a remote branch, Git will create a local branch and set the tracking info automatically.
Anyway, I think we’re all on the same page now so I’m going to close this out. Let me know if you have any other questions about this.
@krpkpraveen we favour having one local repository for each remote repository, and we don’t support passing
--single-branch --branch [branch]
when cloning in the app.