Name: nbgitpuller
Owner: Data Science 8
Description: null
Created: 2017-05-24 19:41:10.0
Updated: 2018-05-24 17:05:51.0
Pushed: 2018-05-09 19:38:27.0
Homepage: null
Size: 2332
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
One-way synchronization of a remote git repository to a local git repository, with automatic conflict resolution.
There is no package on PyPI available right now. You can install directly from master:
pip install git+https://github.com/data-8/nbgitpuller
You can then enable the serverextension
jupyter serverextension enable --py nbgitpuller --sys-prefix
nbgitpuller allows you to construct a URL that points to a remote git repository. When it is clicked, nbgitpuller will pull for the contents of this repository into the user's current folder within Jupyter, while rendering a nice status page. This is especially useful when running on a JupyterHub, since it allows easy distribution of materials to users without requiring them to understand git.
When a link is clicked, we try to make opinionated intelligent guesses on how to do a merge automatically, without making the user have to do a conflict resolution. nbgitpuller is designed to be used by folks who do not know that git is being used underneath, and are only pulling content one way from a source and modifying it - not pushing it back. So we have made the following opinionated decisions.
You should use this when:
You should not use this when:
You can construct a working nbgitpuller URL like this:
pyterhub.org/hub/user-redirect/git-pull?repo=<your-repo-url>&branch=<your-branch-name>&subPath=<subPath>&app=<notebook | lab>
master
.NBGITPULLER_APP
's value or notebook
if it is undefined. The allowed values
are lab
and notebook
, the value will determine in what application view
you end up in.app
and subPath
and redirect
blindly to the specified path.You can easily set up to develop this locally, without requiring a JupyterHub. It requires python3.
Clone this repository
clone https://github.com/data-8/nbgitpuller
Change into it and create a virtual environment
bgitpuller
on3 -m venv .
Install it with symlinks, so you can easily play with it.
install -e .
Enable the jupyter notebook server extension. This provides the git-pull
URL handlers.
ter serverextension enable --sys-prefix nbgitpuller
Run a jupyter notebook locally!
ter notebook
Construct a nbgitpuller URL exactly like you would for a hub, but instead of prefixing it
with myjupyterhub.org/hub/user-redirect
, just use localhost:8888
or whatever the
url of your running notebook is. For example, the following URL would pull down a repo:
lhost:8888/git-pull?repo=https://github.com/data-8/materials-fa17
Make the changes you want to make, and restart the jupyter notebook for them to take effect.
It is also possible to use nbgitpuller
from the command line. For example,
here's how to synchronize the repository listed above using the command line:
uller https://github.com/data-8/materials-fa17 master my_materials_fa17
This will synchronize the master
branch of the repository to a folder
called my_materials_fa17
.
See the command line help for more information.