LoginSignup
2
2

More than 5 years have passed since last update.

gitに追加してしまった不要なファイル群を根絶する。

Last updated at Posted at 2013-06-18

何気なく

git add .
git commit

してしまい、大量の要らないファイルを追加してしまって、それを削除したいとき。

たとえばPythonの*.pycファイルならこんな感じ

find . -name "*.pyc" -print0 | xargs -0 -t git rm --ignore-unmatch

・追加されてないファイルは--ignore-unmatchで対象外に。
・ファイル名、フォルダ名にスペースが入っているものも正しく処理。

2
2
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
2
2