提交 41582337 编写于 作者: Miykael_xxm's avatar Miykael_xxm 🚴

untrack output

上级 637560f9
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 如何让 Git 不在追踪 `ipynb` 文件中的 Output\n",
"\n",
"参考 https://github.com/jupyterlab/jupyterlab-git/issues/392 中提到的 youtube 视频介绍,在 notebook 与 git 的配合使用过程中,可以通过 `nbstripout` 和 `nbconvert` 两个插件搭配使用,在 git 中添加一个过滤器,确保 git 只跟踪 input 的变化,而忽略 output 的变化\n",
"\n",
"具体步骤:\n",
"\n",
"1. pip install nbstripout\n",
"2. pip install nbconvert\n",
"3. 启动 nbstripout `nbstripout --install`\n",
"4. git add files\n",
"5. git commit files\n",
"6. git push files"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install nbstripout nbconvert"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!nbstripout --install"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!python -v"
]
}
],
"metadata": {
"interpreter": {
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
},
"kernelspec": {
"display_name": "Python 3.9.1 64-bit",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册