Package: jupyterlab-gitplus
GitPlusA JupyterLab plugin for version control of Jupyter notebooks. It can,Push GitHub commits from JupyterLabCreate GitHub pull request from JupyterLabDemoCreate GitHub Pull Request from JupyterLabPush GitHub Commits from JupyterLabRequirementsJupyterLab 2.x or 3.xGit (runninggiton cmdline or terminal should work)Install1. Install Required Packagespipinstall--upgradejupyterlab_gitplus
jupyterlabextensioninstall@reviewnb/jupyterlab_gitplus
jupyterserverextensionenable--pyjupyterlab_gitplus2. Setup GitHub tokenTokens are required to make API calls to GitHub to push commits and create pull requests.Head overdeveloper settings on GitHub. Click "Generate New Token".Selectreposcope. Click "Generate Token". Copy the generated token.If~/.jupyter/jupyter_notebook_config.pydoes not existthen create one by runningjupyter notebook --generate-configOpen you Jupyter config file~/.jupyter/jupyter_notebook_config.py& paste the token as shown belowc.GitPlus.github_token='<your-github-access-token>'After installation, start JupyterLab normally & you should see "Git-Plus" as a new menu item at the top.FAQWhere is pull request (PR) opened in case of forked repositories?If your repository is forked from another repository (parent) then PR will be created on parent repository.Which is thebasebranch used in a pull request?basebranch in a PR is a branch against which your changes are compared and ultimately merged. We use repository's default    branch (usually calledmaster) asbasebranch of PR. We use parent repository's default branch asbasein case of forked repo.Which is theheadbranch used in a pull request?headbranch in a PR is a branch which contains the latest changes you've made. We create a new branch (e.g.gitplus-xyz123) asheadbranch. It only contains changes from the files you wish to include in the PR.How can I edit a pull request opened with GitPlus?You can head over to GitHub and edit the PR metadata to your liking. For pushing additional file changes to the same PR,Copy the branch name from GitHub UI (e.g.gitplus-xyz123)Checkout that branch locallyMake the file changes you wantUse push commit functionality from GitPlus to push new changesIs GitPlus tied to ReviewNB in any way?No. GitPlus is it's own open source project. The only connection with ReviewNB is that at the end of PR/Commit creation, GitPlus shows ReviewNB URL along with GitHub URL. You can safely ignore these URLs if you don't want to use ReviewNB.It's is useful to seevisual notebook diffson ReviewNB instead of hard to readJSON diffson GitHub.ReviewNBalso facilitates discussion on notebooks cells.What if I don't have a ReviewNB account?No problem, everything in GitPlus will still work fine. Only the ReviewNB URLs won't work for you.Can we use GitPlus with Gitlab/BitBucket or any other platforms?No, currently we only support repositories on GitHub.MotivationOur aim is to make notebooks a first class entity in Data science & ML teams. We can achieve this by making notebooks play well with existing tools & processes instead of building expensive proprietary platforms. Other projects in this direction are,ReviewNB- Code review tool for Jupyter notebookstreon- Easy to use test framework for Jupyter notebooksRoadmapIn future GitPlus will be able to,Pull changes from GitHubSwitch/create branches locallyResolve notebook merge conflicts (without messing with underlying JSON)DevelopmentInstallThejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment & install dependencies# Link your development version of the extension with JupyterLabjupyterlabextensionlink.# Run jupyterlab in watch mode in one terminal tabjupyterlab--watch# Watch the GitPlus source directory in another terminal tabjlpmwatch# If you make any changes to server side extension (.py files) then reinstall it from sourcepipinstall.ContributingIf you see any problem, open an issue or send a pull request. You can write tosupport@reviewnb.comfor any questions.