You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now this was mitigated in #1366 with the addition of a confirmation dialog, to warn users of potential data loss.
It could however be interesting to still be able to check out remote branches via the UI, and be able to switch back to a local branch, without losing data, and similar to the workflow available via the git command directly.
The text was updated successfully, but these errors were encountered:
jtpio
changed the title
Reconsider the use of -B for the git checkout or remote branches
Reconsider the use of -B for the git checkout of remote branches
Oct 25, 2024
Playing around with this, modifying https://github.com/jupyterlab/jupyterlab-git/blob/main/jupyterlab_git/git.py#L1128 to be a normal git checkout <branch_name> for remote branches works the same as using the command line, the UI reflects being in a detached head state, and switching back to the local branch retains any changes as you would expect.
As noticed in #1352, the
git checkout
command run when clicking on a remote branch uses the-B
flag, which can be quite disruptive as it implies forcing the switch to the branch: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt--Bltnew-branchgtjupyterlab-git/jupyterlab_git/git.py
Line 1141 in da4710f
For now this was mitigated in #1366 with the addition of a confirmation dialog, to warn users of potential data loss.
It could however be interesting to still be able to check out remote branches via the UI, and be able to switch back to a local branch, without losing data, and similar to the workflow available via the
git
command directly.The text was updated successfully, but these errors were encountered: