jupyter notebook如何用git
时间: 2023-12-06 17:03:33 浏览: 337
您可以使用trains-jupyter-plugin扩展来将Jupyter Notebook推送到git存储库。以下是使用trains-jupyter-plugin扩展将Jupyter Notebook推送到git存储库的步骤:
1.安装trains-jupyter-plugin扩展。您可以使用以下命令安装:
```shell
pip install trains-jupyter-plugin
```
2.在Jupyter Notebook中启用扩展。您可以使用以下命令启用:
```shell
jupyter nbextension install --py trains_jupyter_plugin
jupyter nbextension enable --py trains_jupyter_plugin
jupyter serverextension enable --py trains_jupyter_plugin
```
3.配置git存储库。您可以使用以下命令配置:
```shell
jupyter notebook --generate-config
```
然后在生成的配置文件中添加以下内容:
```python
c.TrainsGit.push_remote = 'git@github.com:username/repo.git'
c.TrainsGit.push_branch = 'master'
```
将`push_remote`替换为您的git存储库的URL,将`push_branch`替换为您要推送到的分支。
4.将笔记本推送到git存储库。在Jupyter Notebook中,单击“File”>“Save and Git Push”即可将笔记本推送到git存储库。
阅读全文
相关推荐


















