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

Error switching branch: failed to fetch #741

Closed
Freshwood opened this issue Aug 25, 2020 · 4 comments · Fixed by #1066
Closed

Error switching branch: failed to fetch #741

Freshwood opened this issue Aug 25, 2020 · 4 comments · Fixed by #1066
Assignees
Labels
enhancement Good first issue Good first issue to be tackled by new contributors pkg:Frontend
Milestone

Comments

@Freshwood
Copy link

Actually the git plugin can not re checkout a remote branch
Steps to reproduce:

  • Create a repository to with an additional remote branch e.g. remotes/origin/test
  • Then checkout the remote/origin/test branch
  • The checkout is successful. A new local branch with name 'test' is in the list.
  • Later on when the user click again on the remotes/origin/test branch then the following error is shown:

Error switching branch
Failed to fetch

Please, find attached the STR as GIF:

error-switching-remote-branch

Desired behavior:

  • The plugin re checkout the remote branch and will overwrite (Display dialog box?) the local branch
    OR
  • The plugin will block the checkout of an already checked out remote branch.
@ianhi
Copy link
Collaborator

ianhi commented Aug 28, 2020

Hi @Freshwood I think this may be due to the slashes in the branch name ref: #686

Can you try installing the latest release candidate and see if the issue persists:

pip install jupyterlab-git==0.21.0rc0

@Freshwood
Copy link
Author

Hello @ianhi,

thank you for your reply.
I looked at the code.
The error will be raised in the following line:

cmd = ["git", "checkout", "--track", branchname]

The first try will always work. When you retry to checkout the remote branch (with tracking --track) then you will get an exception. (This is a normal git behavior)

Many thanks

Freshwood

@fcollonval fcollonval added this to the 1.0.0 milestone Sep 22, 2020
@fcollonval fcollonval added the Good first issue Good first issue to be tackled by new contributors label Nov 11, 2020
@3coins
Copy link
Contributor

3coins commented Nov 12, 2021

I can look into this. Please assign this to me.

@fcollonval
Copy link
Member

Thanks @3coins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Good first issue Good first issue to be tackled by new contributors pkg:Frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants