Skip to content

Instantly share code, notes, and snippets.

View syntaxval's full-sized avatar
🏠
Working from home.

syntaxval

🏠
Working from home.
View GitHub Profile
@syntaxval
syntaxval / ghr.sh
Last active September 28, 2018 07:43
Git History Rewrite
# Remove file
git filter-branch --tree-filter 'rm path/to/file' HEAD
# Remove directory
git filter-branch --tree-filter 'rm -rf path/to/directory' --prune-empty HEAD
# Replace a file
git filter-branch --tree-filter 'cp /absolute/path/to/file path/to/file' HEAD
# GPG sign all rewritten history.

Keybase proof

I hereby claim:

  • I am syntaxval on github.
  • I am syntaxval (https://keybase.io/syntaxval) on keybase.
  • I have a public key whose fingerprint is 1DFE D048 B070 23A7 D9B9 8029 7FB5 EF4D 9C22 B993

To claim this, I am signing this object: