this looks luxurious
The git add -p family is what I use all the time.
git add -p
git commit -p
git reset -p
git checkout -p
Instead of going through history, I end up thinking about each of the changes I’ve made as having a theme.
As a result, my flow looks like this, in a day-to-day:
git commit -p -v
git fetch && git rebase origin/master
git rebase -i origin/master
git reset --soft origin/master
I like it when things make sense, and this makes sense in approach and in effect.
More distal but similar:
Mercurial is my git alias, via hg-git. Kinda funny that we already have commands in hg like branch to make a branch and branches to list them (same with tags and bookmarks), as well as uncommit and amend commands.
+1 here. Only small downside is .hg directory contains both hg and git repositories
I think this is a good approach to thinking about aliases - don’t just add shorter nicknames, instead use meaningful new terms - that said, since using magit in emacs, I haven’t bothered with git aliases.
Magit has basically the same approach I just described - the c-e comand (‘[c]ommit->[e]xtend’) is easier for me to remember than ‘commit –amend –no-edit’, and is basically the same alias I’d use if I was using the shell and I set up my aliases on a smart day.