LoginSignup
105
97

More than 5 years have passed since last update.

git rm で fatal: pathspec did not match any filesが出るときの解決方法

Last updated at Posted at 2014-10-24

git rmでディレクトリの中味を空にしようとしました。するとfatalエラーがでました。

rmできないとエラー
git rm -r ./*
fatal: pathspec './hoge' did not match any files

これはGitに登録していないファイルがあると出るらしいです。

どうやら --ignore-unmatch をつけると、Gitに登録していないファイルを無視して削除してくれるみたいです。

Gitに登録していないファイルを無視してrm
git rm -r --ignore-unmatch  ./*

今度はちゃんと削除できました(☝ ՞ਊ ՞)

105
97
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
105
97