Re: How to display "HEAD~*" in "git log"
- From
- kostix@bswap.ru <kostix@bswap.ru>
- Date
- Jul 6, 2022, 12:38 UTC
- Message-ID
- <20220706123811.dwbuinnbtxftorae@carbon>
- In-Reply-To
- <a1e53e52-cb08-bbff-f58a-391932707fb7@mails.ucas.ac.cn>
By the way, you can consider "going more interactive" with the approach which involves scripting. For instance, you can use any of the "fuzzy finders" such as the venerable fzf [1] to interactively select a commit to rebase - something like
$ git log --oneline -50 | fzf | cut -d ' ' -f 1
would produce the log of the last 50 commits, allow you to interactively select a commit of interest by typing some of the characters of its message and/or hash and then print the selected hash.
This can be easily combined with rebasing: for instance, if you have the above encantation available as an alias named "select" or a custom script named "git-select", you could do
$ git rebase -i $(git select)~
to not even copy or memorize anyting.
I, for one, routinely use fzf to pick a branch for checkout.
1. https://github.com/junegunn/fzf