发布于 2018-09-30 13:48:48
检查第557期中提出的命令是否适合您:
bind generic 9 !sh -c "echo -n %(commit) | xclip -selection c && echo Copied %(commit) to clipboard"它将复制剪贴板中的当前提交SHA1。
在Wiki绑定页面中,也有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" # Cygwinbind generic 9 !@sh -c "git rev-parse --short %(commit) | pbcopy"发布于 2021-11-30 23:26:28
发布于 2021-06-25 14:28:22
MacOS
bind generic 9 !@sh -c "printf '%s' %(commit) | pbcopy"或者,复制简短的沙-1:
bind generic 9 !@sh -c "printf '%s' $(git rev-parse --short %(commit)) | pbcopy"灵感来源:示例部分中的/tig/doc/tigrc(5) -绑定命令。
VonC的答案中列出的解决方案对我无效,因为粘贴结果(⌘+V)中有一个返回行,所以我无法在tig :!git rebase -i [paste_here_hitting_⌘+V]~中键入这样的命令。
https://stackoverflow.com/questions/52542803
复制相似问题