Skip to content

Instantly share code, notes, and snippets.

@zentralwerkstatt
Last active August 20, 2020 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zentralwerkstatt/e6c68156e8a9ebe1a9199f1e873a18e9 to your computer and use it in GitHub Desktop.
Save zentralwerkstatt/e6c68156e8a9ebe1a9199f1e873a18e9 to your computer and use it in GitHub Desktop.
Change git history comprehensively
  • On a Mac, we might need to run first: git config --global core.trustctime false
  • Rebase: git rebase -i --root
  • Edit according to instructions
  • Set commit date as author date: git filter-branch -f --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE; export GIT_COMMITTER_DATE'
  • Force push: git push origin +master
  • In case of errors: git rebase --abort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment