LoginSignup
8
6

More than 5 years have passed since last update.

npm使ってるプロジェクトでgitのブランチ移動した時にちゃんとクリーンしたい時のコマンド

Last updated at Posted at 2016-07-27

**注意**ファイルを削除するコマンドを含んでるので、何が起きても保証できません。

git clean -xdf -e .idea && npm cache clean && npm install 

git cleanコマンド Gitで管理してないファイルを削除する

git clean 

オプション

  • x - すべての追跡されていないファイル(リポジトリで管理されていないファイルと .gitignore以下 )
  • d - ディレクトリ以下も検索する
  • f - force = 強制
  • e - 特定のファイルを削除対象から外す (.ideaはWebStorm使いのため無視)
  • n - 取り敢えず確認するだけ

( 先に確認するだけってことで、git clean -xdn -e .idea にしとくと安心 )

npm cache clean && npm install

キャッシュとかもちゃんと消して再インストールする(git cleanでnode_modulesとかも消えてる想定)

8
6
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
8
6