Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you copy from gitbash(Git Bash)

Tags:

git-bash

I'm using git-for-windows MING64 MinTTY running on Windows 7. When I select text on git bash, it always trigger ctrl+C(which will display ^C in the next command line.

e.g.: When I left click down to select “git --version”, then left click up, the next command line becomes “$^C”.

$ git --version

git version 2.9.2.windows.1

$^C

Has anyone ever encounted this issue? And how to fix it? I download the exe file from https://github.com/git-for-windows/git/releases.

screenshot

like image 761
sunny_lunars Avatar asked Jul 28 '16 04:07

sunny_lunars


People also ask

How do I select and copy in bash?

You can now press Ctrl+Shift+C to copy selected text in the Bash shell, and Ctrl+Shift+V to paste from your clipboard into the shell.

How do I copy text from terminal in bash?

Ctrl+Shift+C and Ctrl+Shift+V If you highlight text in the terminal window with your mouse and hit Ctrl+Shift+C you'll copy that text into a clipboard buffer. You can use Ctrl+Shift+V to paste the copied text into the same terminal window, or into another terminal window.


4 Answers

Enter the keyboard combination Alt+Space Bar to open the system menu of the command window. Then use the select and copy options from there.

There's step-by-step expanded instruction here.

See also Copying and Pasting in Git Bash. Excerpt as follows:

Copying and Pasting in Git Bash

The default way to copy/paste in Git Bash is by using the menu (accessed by going to the top left) to "mark" to select what you want to copy and then use the menu again to paste.

This gets inefficient pretty quickly, so it's a good idea to set up QuickEdit mode to make copying and pasting much faster. To do this, go to Menu->Properties and in the Options tab select QuickEdit Mode.

enter image description here

like image 151
CryptoPiggy Avatar answered Oct 03 '22 12:10

CryptoPiggy


  • on windows 10
  • Git-bash( git version 2.14.1.windows.1)

copy: CTRL + INSERT
paste: SHIFT + INSERT

Source here

like image 39
christianbueno.1 Avatar answered Oct 03 '22 11:10

christianbueno.1


  • Copy: Ctrl + (Left Click Highlight)
  • Paste: Right Click
like image 39
MJ Montes Avatar answered Oct 03 '22 11:10

MJ Montes


You can use autohotkeys to convert Shift + Insert to another shotcut you want. I use this way in my autohotkeys file:

^+v::^Ins

To me is better Ctrl+Shift+V instead of Ctrl+V to avoid compatibility issues with vim, but if you don't use vim you can use the common way.

Another solution is use console emulators like conemu it allows you edit all shotcuts.

like image 41
Cleberson Gomes da Costa Avatar answered Oct 03 '22 13:10

Cleberson Gomes da Costa