Jupyterlab-git requires Git authentication for operations like stage, unstage, and diff

Is it normal for Git, when running JupyterLab with jupyterlab-git extension, to require authentication for every single Git operation, including those which shouldn’t require it? For example, visualizing the diff of a notebook inside JupyterLab asks me for Git authentication.

I’m running jupyterlab==3.2.0 with jupyterlab-git==0.33.0 for notebooks in a Git repository, which has a SSH key as a deploy key. I noticed that, for each Git operation, it requires me to type my SSH key passphrase at the terminal. This should not be a problem, however even simple Git operations using the graphical interface, such as stage, unstage, and diff, require me to type the passphrase, not only pull, fetch, and push, as usual through the command line.

I was wondering if this is an intended behavior, maybe I’m missing something. Just in case, the packages are installed in a Conda environment in a Ubuntu 20.04 machine.

1 Like

Hey the password prompt is probably related to the recurrent fetch operation carried out by the extension. Credentials are (almost) not handled by the extension. The way to deal with them is to use the git mechanism. Meaning for SSH authentication, you should spin a ssh-agent to serve your credentials. And for HTTP authentication, I would recommend using a git credentials helper such as the standard cache helper: see Cache git credentials via the jupyterlab-git extension · Issue #659 · jupyterlab/jupyterlab-git · GitHub

1 Like

SSH keys are the way to go for trusted environments, but it still should be possible to view a diff on say Binder without providing credentials.

1 Like

Hi there,

So each operation of the extension performs a fetch, besides the expected operation? For instance, a diff operation performs both fetch and diff? Is this necessary?

Thanks, I’m following this procedure.

Let me clarify, there is a recurrent process fetching information from the remotes. But fetch is not explicitly called when creating a diff view.

Oh, I see, thanks. Do you happen to know which is the time between two recurrent fetches? Is it possible to change it?

Hey the interval can be set through extension settings refreshInterval. Its default value is 3000ms.

1 Like