Using the Git Plug-in
For notebook instances with the GitHub code library, you can use the Git plug-in on the JupyterLab page to quickly view the content and submit the modified code.
Prerequisites
A notebook instance with a Git repository has been created and is in the Running state.
Opening the Git Plug-in of JupyterLab
- In the notebook instance list, select an instance with a Git repository and click the name to open the notebook instance.
- On the Jupyter page, click Open JupyterLab in the upper right corner. The JupyterLab page is displayed.
Figure 1 shows the Git plug-in of JupyterLab.
Viewing Code Library Information
In the list under Name, double-click the folder you want to use and click the Git plug-in icon on the left to access the code library corresponding to the folder.
Viewing Content Changes
If you modify a file in the code library, you can view the modified file under Changed on the Changes tab page. You can click Diff this file on the right of the file name to view the changes to the file content.
Committing Content Changes
After confirming that the changes are correct, click Stage this change (equivalent to running the git add command) on the right of the file name. The file enters the Staged state. Enter the message to be committed in the lower left corner and click Commit (equivalent to running the git commit command).
On the History tab page, you can see that the committing is successful.
Clicking the push button is equivalent to running the git push command to push the code to the GitHub repository. After the pushing is successful, the message "Git Push completed successfully" is displayed. If the token used for OAuth authentication has expired, a dialog box is displayed asking you to enter the user token or account information. Enter the information as prompted.
After the preceding operations are completed, on the History tab page of the Git plug-in page of JupyterLab, you can see that origin/HEAD and orgin/master point to the latest push. In addition, you can find the corresponding information in the committing records of the GitHub repository.
Last Article: Synchronizing Files with OBS
Next Article: Setting the Initialization Script

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.