15 lines
752 B
Plaintext
Raw Normal View History

2024-12-11 15:47:37 +00:00
jiraTicket said Got any git tips that everyone might not be aware of?
My tip is fixup and autosquash!
If I'm working in a branch with many commits and I notice that 5 commits ago I made a tiny mistake on commit 'abc123' then I'll just do `git commit --fixup abc123`.
It's similar to `--amend` but you can do it for any commit.
At first this would be a separate commit. But next time I wanna rebase I'd just do `git rebase -i --autosquash origin/master` and it'll be squashed into abc123
Some article that explains further details:
* https://gist.github.com/naviat/...
* https://blog.sebastian-daschner.com/...
After discovering I had been unaware of this for years I figure there must be other similar useful git things I might be unaware of```