How to copy text in gitk

吃可爱长大的小学妹 提交于 2019-12-03 15:34:05

问题


Can I copy source code in the left-bottom panel in gitk? Any keyboard shortcut or other functions?

OS: Ubuntu 9.04 Desktop / gitk: 1:1.6.0.4-1ubuntu2

Thank you.


回答1:


Workaround:

  1. Right-click on the source code you want to copy.
  2. Select "Run git gui blame on this line."

This opens up a new gui blame editor with full copy/paste functionality.




回答2:


It should support the (X clipboard style) copy, even though a bug has been reported for that feature on Ubuntu:

gitk supports the normal X clipboard: select to copy, middle-click to paste.

My mouse does not have a middle button and select isn't copying.
It would be immensely useful to have:

  • the copy and paste options available:
    • in the edit menu,
    • or right click menu,
  • or supporting the standard Ctrl+c, Ctrl+v keyboard shortcuts.



回答3:


I had trouble with this on Ubuntu (with Gnome) as well. However I found I could select text and then use 'xclip -o' to print it to the console (which I could then use/copy as normal). I guess the X clipboard is separate from the normal Gnome clipboard.




回答4:


Run Gitk in backgroup mode and don't close it while you paste. The clipboard will work better while gitk is still running.

$ gitk &

You can also make it as function in ~/.bashrc or ~/.bash_aliases

function gitk() { 
    /usr/bin/gitk $@ & 
}



回答5:


I also have exactly the same problem on my Ubuntu 16.04 with gnome desktop. It seems a bug in old version and fixed in latest version. Upgrade gitk with these steps:

git clone git://ozlabs.org/~paulus/gitk
cd gitk
make
sudo copy gitk /usr/bin/gitk


来源:https://stackoverflow.com/questions/3341061/how-to-copy-text-in-gitk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!