LoginSignup
0
0

More than 3 years have passed since last update.

.gitignoreに指定した対象はコミットできないのか?

Posted at

git add . で追加しても追加されない。
git add した場合には追加できなとメッセージが表示される。

% git add sample.html
The following paths are ignored by one of your .gitignore files:
sample.html
Use -f if you really want to add them.

ただし -f オプションを使うと追加できるようだ。
.gitignoreに指定したファイルを-f(--force)で追加するのは、追加してはいけないと設定しているのに、でも強制的に追加します!みたいな感じなので、かなりの割合でやらないほうが良いです。

git rm は可能で、特に警告も出ません。
追加してはいけない設定にしたファイルを消すのは特に不自然ではなからでしょうね。

% git rm sample2.html
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