LoginSignup
41
42

More than 5 years have passed since last update.

すでにリポジトリで管理されているファイルを.gitignoreで除外したい場合の手順

Posted at

すでにリポジトリで管理されちゃってるけど、本当は除外すべきだったファイルがあった時に、.gitignoreを編集して除外対象にしたい場合の手順。(最新の.gitignoreの設定を反映する方法)

一度インデックスを全部クリアする

git rm -r --cached .

改めてインデックスを作りなおす

git add .

これで新しく.gitignoreで除外したいファイルがdeletedになる。(ワーキングツリーには残ったままで、インデックスから除外できる)

あとはcommitして完了。


Blog URL : http://www.utano.jp/ (Syntax Error.)

41
42
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
41
42