Rewriting Git History
Published on 04 Sep 2020
Rewriting Git History
https://backlog.com/git-tutorial/rewriting-history/#git-merge-squash https://thoughtbot.com/blog/git-interactive-rebase-squash-amend-rewriting-history
Ammend
- Change comment
git commit --amend
- Change files (add/delete/edit)
git add README.md config/routes.rb
git rm notes.txt
git commit --amend
- change author
git commit --amend --author="Tute Costa and Dan Croak <[email protected]>"
Interactive Rebase
- change the last 4 commits
git rebase -i HEAD~4
Squash commits together
- Rebase on top of master
git remote add upstream https://github.com/thoughtbot/factory_girl.git
git fetch upstream
git checkout feature
git rebase upstream/master
git push --force origin feature
all tags
IDE architecture" cli crontab crypto csv database docker editor error exceptions fastapi ffmpeg filename git go history http iteration javascript linux logging me mysql numpy orm pdo pentaho php postgres python random rename rsync rust selenium server solana sql sqlite ssh typescript user w3m wordpress