LoginSignup
19
27

More than 5 years have passed since last update.

.gitignore で、git のバージョン管理から無視するファイルを設定する

Last updated at Posted at 2012-05-23

git initとしたフォルダーに.gitignore ファイルを作れば、そこに書かれたファイルは git のバージョン管理から無視されます。

.gitignoreの配置場所

C# で使う場合の例:

# .gitignore
#       git initとしたフォルダーに.gitignore ファイルを作れば、
#       そこに書かれたファイルは git のバージョン管理から無視されます。

# [書き方]
#       行頭に # を書くとその行はコメントとみなされ、無視されます
#       *.a         # .a ファイルは無視
#       !lib.a          # しかし、lib.a ファイルだけは .a であっても追跡対象とします
#       /TODO       # ルートディレクトリの TODO ファイルだけを無視し、サブディレクトリの TODO は無視しません
#       build/      # build/ ディレクトリのすべてのファイルを無視します
#       doc/*.txt   # doc/notes.txt は無視しますが、doc/server/arch.txt は無視しません
bin/
obj/
**/tags

# .gitignore ファイル自体は管理したい
#       ! は、無視の打ち消し、すなわち無視しない
!.gitignore

先週紹介した Milkode も、.gitignore ファイルを解析してくれるらしいので、設定しておいて損はないかと。

19
27
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
19
27