I love to use tig client to navigate through git commits.
But I'm missing one thing for now.
Is there a key binding to take a sha number of a git commit I'm currently staying at?
Check if the command proposed in jonas/tig
issue 557 would work for you:
bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard"
That would copy the current commit SHA1 in your clipboard.
In the Wiki binding page, you also have example for Mac or Cygwin:
bind generic 9 !@sh -c "git show -s --format=%s %(commit) | xclip -selection c" # Linux
bind generic 9 !@sh -c "git show -s --format=%s %(commit) | pbcopy" # Mac
bind generic 9 !@sh -c "git show -s --format=%s %(commit) > /dev/clipboard" # Cygwin
The OP megas proposes in the comments to use git rev-parse
:
bind generic 9 !@sh -c "git rev-parse --short %(commit) | pbcopy"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With