あれ、どうやって書くんだっけ。とふと思ったので、備忘録がてらまとめました。
.gitignore について
Git で管理されないファイルの事を言う。
ignore とは、「無視する、黙殺する、聞きながす、気付かないふりをする」などの意味がある。
よって、管理したくないファイルなどは、.gitignore というテキストファイルを使うのが良い。
書き方
sample ディレクトリに .gitignore が置かれているとしたケース
sample
-- test_01.txt
-- test_02.txt
-- test_03.txt
- ファイル名を直接指定する
test_01.txt
- ディレクトリの指定(以降にあるファイルやフォルダも全て対象となる)
sample/
- 例外を使って、test_02.txt だけは除外したい場合
!/sample/test_02.txt
- 拡張子を指定したい場合
*.png
- コメント
# 「#」でOK
以上。