1 Star 1 Fork 1

Git工具集 / jupyterlab-git

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

jupyterlab-git

Binder Build Status Version Version Downloads Version Downloads All Contributors

A JupyterLab extension for version control using Git

ui_glow_up

To see the extension in action, open the example notebook included in the Binder demo.

Prerequisites

  • JupyterLab
  • Git (version >=2.x)

Usage

  • Open the Git extension from the Git tab on the left panel

Install

To install perform the following steps:

pip install --upgrade jupyterlab-git
jupyter lab build

Settings

Once installed, extension behavior can be modified via the following settings which can be set in JupyterLab's advanced settings editor:

  • disableBranchWithChanges: disable all branch operations, such as creating a new branch or switching to a different branch, when there are changed/staged files. When set to true, this setting guards against overwriting and/or losing uncommitted changes.
  • doubleClickDiff: double click a file in the Git UI to open a diff of the file instead of opening the file for editing.
  • historyCount: number of commits shown in the history log, beginning with the most recent. Displaying a larger number of commits can lead to performance degradation, so use caution when modifying this setting.
  • refreshInterval: number of milliseconds between polling the file system for changes. In order to ensure that the UI correctly displays the current repository status, the extension must poll the file system for changes. Longer polling times increase the likelihood that the UI does not reflect the current status; however, longer polling times also incur less performance overhead.
  • simpleStaging: enable a simplified concept of staging. When this setting is true, all files with changes are automatically staged. When we develop in JupyterLab, we often only care about what files have changed (in the broadest sense) and don't need to distinguish between "tracked" and "untracked" files. Accordingly, this setting allows us to simplify the visual presentation of changes, which is especially useful for those less acquainted with Git.

Troubleshooting

Before consulting the following list, be sure the server extension and the frontend extension have the same version by executing the following commands:

jupyter serverextension list
jupyter labextension list
  • Issue: the Git panel does not recognize that you are in a Git repository.

    Possible fixes:

    • Be sure to be in a Git repository in the filebrowser tab

    • Check the server log. If you see a warning with a 404 code similar to: [W 00:27:41.800 LabApp] 404 GET /git/server_root?1576081660665

      Explicitly enable the server extension by running:

      jupyter serverextension enable --py jupyterlab_git
    • If you are using JupyterHub or some other technologies requiring an initialization script which includes the jupyterlab-git extension, be sure to install both the frontend and the server extension before launching JupyterLab.

  • Issue: the Git panel is not visible.

    Possible fixes:

    • Check that the JupyterLab extension is installed:

      jupyter labextension list

      If you don't see @jupyterlab/git v... enabled OK in the list, explicitly install the jupyter labextension by running:

      jupyter labextension install @jupyterlab/git

Development

Contributing

If you would like to contribute to the project, please read our contributor documentation.

JupyterLab follows the official Jupyter Code of Conduct.

Install

Requires NodeJS

# Install new-ish JupyterLab
pip install -U jupyterlab

# Clone the repo to your local environment
git clone https://github.com/jupyterlab/jupyterlab-git.git
cd jupyterlab-git

# Install the server extension in development mode and enable it
pip install -e .[test]
jupyter serverextension enable --py jupyterlab_git --sys-prefix

# Build the labextension and dev-mode link it to jlab
jlpm
jupyter labextension link .

To rebuild the package after a change and the JupyterLab app:

jlpm run build
jupyter lab build

To continuously monitor the project for changes and automatically trigger a rebuild, start Jupyter in watch mode:

jupyter lab --watch

And in a separate session, begin watching the source directory for changes:

jlpm run watch

Now every change will be built locally and bundled into JupyterLab. Be sure to refresh your browser page after saving file changes to reload the extension (note: you'll need to wait for webpack to finish, which can take 10s+ at times).

To execute the tests

pytest jupyterlab_git
jlpm run test

Contributors ✨

The Jupyter Git extension is part of Project Jupyter and is developed by an open community of contributors. To see who has been active recently, please look at the "Contributors" tab. Below we list the people and entities who contributed in different ways to the project (emoji key):


Amazon Web Services

🤝

Ashutosh Bondre

💻 👀

Athan

💻 👀 📆 🎨

Brian E. Granger

📆 🎨 🤔 🔍

Frédéric Collonval

🚧

Hana Zarea

💻 👀

Jaipreet Singh

📆 👀 💻 🎨

Ji Zhang

💻 👀

Konstantin Taletskiy

💻 👀

Max Klein

💻 👀 📆 🎨 🚇

Neelam Gehlot

💻 👀

Noah Stapp

💻 👀

Saul Shanabrook

💻 📆 👀 🚇

The D. E. Shaw Group

🤝

jupytercalpoly

🤝

This project follows the all-contributors specification. Contributions of any kind welcome!

To add yourself, or someone else, to this list you can either use the bot (@all-contributors please add <username> for <contributions>) or the CLI (jlpm all-contributors add <username> <contributions>).

If you manually edit the .all-contributorsrc config file, run yarn run contributors:generate

BSD 3-Clause License Copyright (c) 2017, Project Jupyter Contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

A Git extension for JupyterLab 展开 收起
TypeScript
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/vcs-all-in-one/jupyterlab-git.git
git@gitee.com:vcs-all-in-one/jupyterlab-git.git
vcs-all-in-one
jupyterlab-git
jupyterlab-git
master

搜索帮助