LoginSignup
0
0

More than 5 years have passed since last update.

《Git》すでにインデックスされているファイルを監視対象から外す

Last updated at Posted at 2017-01-24

すでにインデックスされているファイルを監視対象から外す

すでにインデックスされているファイルをローカルに残したいけどレポジトリからは削除したいとき。インデックスされているファイルを監視対象から外す。

まず.gitignoreに除外したいファイルやディレクトリを記述します。

.gitignoreの仕様詳解

.gitignore

your_directory
your.html

ターミナルでコマンドを入力します。

terminal

git rm -r --cached your_directory/

または

git rm -r --cached your.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