LoginSignup
7
4

More than 5 years have passed since last update.

自分で.gitignoreを書く

Posted at

自分で.gitignoreを書く時わからなくなったこと

普段frameworkに任せていたので、自分で.gitignoreを書こうと思ったらすぐに出てこなかったため残します。

置く場所

基本はプロジェクト直下に起きますが、.gitignoreが置かれた階層以降を対象とするため何処でも機能するっぽい。

project
  files
  src
  .gitignore

書き方

.gitignoreが起点になることに注意。
例えば、files直下を無視したい場合は、

files/aaa.txt
files/bbb.txt
files/ccc.txt

もしくは、ワイルドカードでまとめて無視する

files/*

bashで$git statusで確認すると、対象外になっていることがわかるであろう。

7
4
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
7
4