blog

12020-10-27

SEAN K.H. LIAO

squashed git

extending git notes

Don't know about you, but my git history usually contains a bunch of errors that isn't going to be useful to anyone. So I think having everything related to a change in a single commit is a very good idea (also linear history!).

git

git, being git, has quite a few ways to achieve the same effect.

rebase

git rebase -i main from the working branch and change all the commits after the first to f or s (f will likely let you skip handling a bunch of conflicts).

reset

git reset --soft main and git commit -m "...". Works by forgetting all history and creating a new commit with the final results.

other notes

git checkout -B branch sets branch to point to whereever you are now