Setting up Git extension for JupyterLab

Finally, let's look at how Git works inside JupyterLab. While there are many visual interfaces, this one integrates with your Notebook workflow.

Git for JupyterLab is an official Jupyter Lab extension. There are two main ways to install it – one might be easier on some computers than others. If none of these work for you, then refer to the JupyterLab documentation on extensions here and the Git extension's documentation.

Method 1: JupyterLab Extension Manager

You should be able to turn this on from inside JupyterLab using the "palette" or under "Settings" in the menu bar. If this option is not available, you may need to upgrade your JupyterLab version. You can open Conda Navigator and click the gear above Jupyter Lab or type in:

pip install --upgrade jupyterlab

Method 2: Install Through Anaconda Prompt (or Terminal)

To get it working, open your Anaconda Prompt (or Terminal on macOS) and type in:

pip install --upgrade jupyterlab-git
jupyter lab build

You can also do this from a Jupyter cell an

!pip install --upgrade jupyterlab-git
!jupyter lab build

From there, just simply close and reopen Jupyter Lab! There should be a panel on the left called "Git" now. To git add a file, just hover your cursor on the file in the "Git" panel and click on the up button on the left.

When you're reading to make a commit, type in a commit message and then the check box. That's it! If you want to push changes to a remote repository, relevant buttons will also appear if you configured them like shown in the first part of this section.

Other Useful Extensions

Last updated