0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

.ipynb_checkpoints を一行で .gitignore に書く方法

Posted at

背景

Jupyter Notebook を使っていると、自動生成される .ipynb_checkpoints フォルダがリポジトリに増えてしまいます。
これを Git で無視する場合、今まではこんな感じで書いていました。:

.gitgnore
*/.ipynb_checkpoints/
*/*/.ipynb_checkpoints/

これは複数行になってしまい、毎回追記していくのは大変です。
しかし、実は 一行で全階層の .ipynb_checkpoints を無視 することが可能です。

解決方法

.gitgnore
**/.ipynb_checkpoints/
  • **/ → 任意の階層(サブフォルダも含む)を意味します
  • .ipynb_checkpoints/ → ディレクトリとして無視
  • この一行で ルート直下もサブフォルダ直下もすべて無視 できます

これでリポジトリが .ipynb_checkpoints で散らからなくなります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?