NBGitPuller
What Is nbgitpuller?¶
NBGitPuller allows you to share and distribute content from Git repositories (e.g., Jupyter Notebooks) with students via a shareable link. There is no need to manually download files or upload them to JupyterHub. Knowledge of Git or other version control systems is not required.
What Happens When Users Click the Link¶
This link opens the JupyterHub (login required), automatically downloads the latest version of the remote repository and redirects directly to the desired directory or notebook.
⚠️ Important: Collecting content from your users requires an alternative method, as
NBGitPullerdoes not “push” and only “pulls”. So if the users want to push to agitrepository, they have to directly usegit. Avoid mixinggitwith automaticnpbitpullersince it can cause problems.
See the nbgitpuller documentation for more information.
Generate a Link¶
Option A – Use the Link Generator Tool
-
Go to: nbgitpuller link generator (or direct generator link from docs)
-
Fill in:
- JupyterHub base URL (e.g. https://uni-muenster.jupyterhub.nrw)
- Git repository URL: e.g.
https://github.com/jakevdp/PythonDataScienceHandbook(remember to remove.gitfrom the URL so that the created folder does not have it as a part of the folder name) - Branch (e.g.
mainormaster) - File to open (optional – path to .ipynb) : e.g.
notebooks/01.00-IPython-Beyond-Normal-Python.ipynb
-
Click "Generate Link"
-
Paste the generated link into Learnweb, Moodle, or an email, for example.
⚠️ Important: Please note that you have to change
treetolab/treein theurlpathof the generated link, so that the notebook will be opened in a jupyterlab session and not just in the classic Jupyter notebook interface.
Option B – Build a Link Manually Format:
https://<JupyterHub-URL>/hub/user-redirect/git-pull?
repo=<GitRepoURL>&
branch=<branch-name>&
urlpath=<interface>/<repo-folder>/<notebook>
<interface>: /lab/tree
Example:
https://uni-muenster.jupyterhub.nrw/hub/user-redirect/git-pull?
repo=https://github.com/jakevdp/PythonDataScienceHandbook&
branch=master&
urlpath=lab/tree/notebooks/01.00-IPython-Beyond-Normal-Python.ipynb