Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement checkout of remote branches #1516

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jan 23, 2025

Fixes #1156

  • Extend "Branch" submenu to include Remote branches not yet fetched locally
  • Allow remote branches to be fetched to new matching and linked local branch

Note that the overwriting part of this issue is down to using Ggit.CheckoutStategy.FORCE when checking out the other branch. Ggit.CheckoutStrategy.SAFE was tried but resulted in unwanted staged files representing the reverse of the changes made to the other branch (but these are not visible in Code). There are many other Ggit.CheckoutStrategy flags available but it is not clear which if any of these would be better.

The solution adopted here is to advise the user to back out and resolve the uncommitted changes before switching branch but to offer to overwrite the changes anyway.

Screenshot from 2025-01-29 12-13-47

@jeremypw jeremypw changed the title Show remote branches in Project context menu Confirm overwrite of uncommitted changes on checkout; Include remote branches Jan 25, 2025
@jeremypw jeremypw marked this pull request as ready for review January 25, 2025 19:06
@jeremypw jeremypw changed the title Confirm overwrite of uncommitted changes on checkout; Include remote branches Implement checkout of remote branches Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProjectFolder menu: "Branch" option does not show remote branches
1 participant