```
[rebase]
instructionFormat = %s%nexec GIT_COMMITTER_DATE=\"%cI\" GIT_COMMITTER_NAME=\"%cN\" GIT_COMMITTER_EMAIL=\"%cE\" git commit --amend --no-edit%n
committerDateIsAuthorDate = true
```I know that's not a popular answer, but I'm just trying to demonstrate the reality that this kind of knowledge isn't specialized anymore.
Even better than ChatGPT is just doing the thing on reflex. Not every manual step is necessarily a tedious chore nor even slower when you actually know what you're doing.
I'm not saying this out of hubris, but there's no man vs machine story here when the machine needs babysitting and is still worse at everything. Nobody is resisting AI at this point. We just need to get shit done and that always requires knowing something. Every new technology quickly hits a ceiling and finds its niche. This isn't it.
I promise you nobody is trying to show off. Git's CLI is notoriously inconsistent and verbose, and every GUI for it is always missing a ton of relevant features because it was designed for someone else's itch.
Now we have people like you trying to wedge AI into the discussion. I'm sorry dude. There's nothing to argue here. Git is the most important tool we have as developers. It's worth learning because the whole point is precise changes. We put up with the bad interfaces because it's otherwise just that good.
This comment gets it correct https://news.ycombinator.com/item?id=49504860
I wrote my own version to do this nearly 10 years ago: https://github.com/amarshall/git-recent-branches
> git config branch.sort committerdate
> You can also supply this on a one-off basis as git branch --sort committerdate.
These don't seem like hacks to me. What do you have in mind?
It opens a fuzzy finder window showing the branches you have in the repo, sorted by recency. Also shows the latest committer and the date. Hit enter on the one you want to swap to it.
https://github.com/tyre/recent-branches
Enjoy!
gi() {
git branch --sort=-committerdate |\
grep -v '^\*' | cut -d' ' -f3 | fzf |\
xargs git checkout
}
fzf handles the TUI partWhat’s also funny is that early in my career I could tell other engineers looked down on me for using a git UI, perhaps assuming I was too stupid to use the terminal. I suspect that this mindset propagates git use to the next generation.
This was one of the better usability changes I made to git, yes you should probably set it for yourself
alias git-hot-refs="git branch --sort=committerdate | tail"
git config --global tag.sort -creatordate
(`-creatordate` reverses the sort so that the newest come first.)