Pulling repo only pulls current branch
See original GitHub issueDescription
Version
- GitHub Desktop: 1.5.0
- Operating system: MacOS Mojove 10.14.1
Steps to Reproduce
- Check out a different branch, e.g. switch from
repo/branch-1
torepo/branch-2
- Make changes to the previously checked out branch, e.g.
repo/master
, from a different source (like adding commits or deleting the branch) - Pull repo in Desktop via
Repository > Pull
orShift + Command + P
Expected Behavior
All branches should be pulled.
Actual Behavior
Only the current branch is pulled.
Additional Information
I believe this issue was not present in a present in previous versions of Desktop.
Commits added to the branch not checked out, e.g. branch-1
, are not reflected in Desktop after pulling the repository via above steps, so for example attempting to merge from that branch into, say, branch-2
may yield “branch-2
is up-to-date” when in fact it is not. The workaround in this case is to stash any staged/unstaged changes, check out branch-1
, pull, return to branch-2
, and merge.
Checked out branch staging
has additional commits on remote
Check out branch conflicts-expansion
and pull from remote
Attempt to merge from staging
into conflicts-expansion
After switching to staging
, pulling, then switching back to conflicts-expansion
If, say, branch-2
is deleted, it is still in Desktop (on the local machine) and commits can be added. When attempting to pull while this branch is checked out, a modal says, “Your configuration specifies to merge with the ref ‘refs/heads/branch-2’ from the remote, but no such ref was fetched.” Desktop does recognize the branch was deleted as it does give the option to publishbranch-2
.
A deleted branch is checked out
Attempting to pull from a deleted branch
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
I wouldn’t call it disruptive, as there is a workaround (stash, switching, pulling, switching, stash pop), but it can be troublesome if you think you’re up to date and you’re not. It’s really more of an annoyance than anything else.
Take the example I used above.
Say someone working on
staging
mentioned to me that they fixed a bug, adding the commitY
. I (still inconflicts-expansion
) pull and merge fromstaging
intoconflicts-expansion
and see the bug is still there — because commitY
was never actually pulled, but there is no indication in Desktop. They try to reproduce the issue and can’t. Finally I check outstaging
and see that there is an unpulled commit.@ezracelli I’m going to close this out due to inactivity. It looks like this specific case is the same as your request (fetching changes to ensure branches are up-to-date when performing a merge). You can follow https://github.com/desktop/desktop/issues/10687 for updates about that.