首页 > 解决方案 > 如何从 git 中排除 Jupyter 笔记本检查点

问题描述

我的 .gitignore 文件如下:

.ipynb_checkpoints
*/.ipynb_checkpoints/*

但是当我执行 git status 时,我仍然会跟踪检查点。

C:\python_git\python3>git status
On branch main
Your branch is up to date with 'origin/main'.

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   Lists/.ipynb_checkpoints/List Basic Operations-checkpoint.ipynb
            modified:   Lists/List Basic Operations.ipynb
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            .gitignore
    
    no changes added to commit (use "git add" and/or "git commit -a")

标签: pythongitjupyter-notebookgitignore

解决方案


推荐阅读