最佳答案
检查是否在 jonas/tig
issue 557 中提出的命令会为你工作:
bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard"
那会复制 current commit SHA1在你的剪贴板中。
在Wiki binding page ,您还有 Mac 或 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
OP megas建议in the comments使用 git rev-parse
:
bind generic 9 !@sh -c "git rev-parse --short %(commit) | pbcopy"
关于git - 获取tig提交的sha数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52542803/