LoginSignup
4

More than 5 years have passed since last update.

githubに間違ってpushしてしまった時の特定のファイル削除法

Last updated at Posted at 2017-10-09

git filter-branch -f --index-filter 'git rm --ignore-unmatch ファイル名' HEAD

コミット履歴から削除したいファイル名の指定。

git push --force origin master

このコマンドで削除したいファイルを指定していけば、github上の指定ファイルだけコミット履歴から消えます。便利。助かった。

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
4