0
0

More than 1 year has passed since last update.

.gitignoreの使い方

Posted at

.gitignoreとは

Gitによる追跡の対象外となるファイルを書き込む設定ファイルのこと。
.gitignoreにファイルを記述すれば、git add時にインデックスに追加されないようになる。
記述は後に書いた除外設定が上書きをしていくので注意。

記述

# コメントアウトの記述可能

# 追跡しないファイルを指定
.gitignore
.env
.htaccess


# ディレクトリや、ディレクトリ内のファイルも指定可能
config/
config/file.html


# ワイルドカード、文字クラスも使用可能
.ht*
*.jpg
file_0[1-9].html


# 否定表現の!も使用可能
# 特定のファイルのみ追跡
!/only-track.html
!*.jpg

参照

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