-
Notifications
You must be signed in to change notification settings - Fork 323
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
Commit is lost when switching from the local branch to the origin branch #1352
Comments
So this issue is caused by the I've been trying to find a fix that maintains the current behavior of creating a local copy of the remote branch, but without losing any commits. I think the best so far is doing |
To add more context, this is what happens when using the
Then running |
Right, wondering if this It does seem to force the checkout of the branch, which does result in the loss of local changes: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt--Bltnew-branchgt Maybe a temporary workaround to not change the current behavior could be to show a confirmation dialog that would mention the potential loss of changes, and ask users if they want to proceed with the checkout of the remote branch. |
Description
Using the branches UI to switch between branches:
Seems to be reverting local changes.
Reproduce
origin/main
jupyterlab-git-branch-switch-issue.webm
Expected behavior
I would expect to be able to temporarely switch to the remote branch, and then switch back to the local branch and see the new changes again.
Context
The text was updated successfully, but these errors were encountered: