Skip to content

Instantly share code, notes, and snippets.

@naokazuterada
Created July 2, 2018 06:08
Show Gist options
  • Save naokazuterada/a0577a1a3b7b5280bbc7d847732300bd to your computer and use it in GitHub Desktop.
Save naokazuterada/a0577a1a3b7b5280bbc7d847732300bd to your computer and use it in GitHub Desktop.

履歴からのみ削除する(ワーキングツリーには残る)

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

履歴からもワーキングツリーからも削除する

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

引用元

wp/wp-content/uploads以下を全部なかったことにする

git filter-branch -f --index-filter 'git rm -rf --ignore-unmatch wp/wp-content/uploads' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment