Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy text in gitk

Tags:

gitk

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.

like image 293
sfsn Avatar asked Jul 27 '10 05:07

sfsn


4 Answers

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.
like image 154
VonC Avatar answered Nov 15 '22 08:11

VonC


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.

like image 31
Mark Mussetter Avatar answered Nov 15 '22 08:11

Mark Mussetter


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.

like image 5
Rick Byers Avatar answered Nov 15 '22 07:11

Rick Byers


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 $@ & 
}
like image 2
Michael Avatar answered Nov 15 '22 08:11

Michael