Skip to content

Instantly share code, notes, and snippets.

@zchee
Last active August 29, 2015 14:04
Show Gist options
  • Save zchee/964677fe0e70b9d09114 to your computer and use it in GitHub Desktop.
Save zchee/964677fe0e70b9d09114 to your computer and use it in GitHub Desktop.
Git Command

特定のファイル履歴を削除

git filter-branch --index-filter 'git rm --cached --ignore-unmatch targetfile' HEAD
git commit -m 'delete targetfile'
git push origin master --force

特定のフォルダ履歴を削除

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch dir' HEAD
git commit -m 'delete targetfolder'
git push origin master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment