GIT - how to copy SHA without mouse on OSX?
Just memorize the first couple of letters / numbers.
Git doesn't need a full hash for rebase, it only needs the first couple of characters.
(minus additional fixation items)
Now, let's say you want the second one,
you can just reinstall the symbols of the first pair.
git rebase 11be
Additional info: Technically, git only needs a unique hash start. So in this case
git rebase 1
it would be enough, because no other hash-fixers started with 1. However, in extreme cases, you may need more than 4-5 characters (very unlikely)
Also, feel free to use
git log -n
to get only the last number of numbers. By keeping this low, the commit is still usually on your screen when you rebase, so you don't have to remember. Just copy the first couple of characters manually. Hint: if git flushes the log output, as soon as you hit "q" to exit, you can use the command
git --no-pager log -n
to get the "stick" output.
For more information on git and rebase, if you knew you wanted to rebase exactly 4 commits, you can simply use the link
. Your current commit
and 1 commit ago -
etc. For example:
git rebase HEAD~4
(as we reboot to
source to share