736

I'm using msysgit running on Windows XP.

Tried Ctrl+V, Right click, Middle click, google... no luck.

3

36 Answers 36

1070

Press Insert.

Also, to copy from the window, try clicking the console's window icon (topleft) and choosing Edit -> Mark, then drag a box on the text, then press Enter. (You can also paste via the window icon menu, but the key is faster.)

UPDATE

Starting from Windows 10 the CTRL + C, CTRL + V and a lot of other feature are implemented in conhost.exe so they should work with every console utility on Windows. (You have to enable Properties -> Option tab -> Quick Edit Mode)

Ref: http://blogs.windows.com/buildingapps/2014/10/07/console-improvements-in-the-windows-10-technical-preview/

24
  • 30
    What I want is to paste content into git bash. But thanks to you, I spotted Edit -> Paste which is exactly what I want! No more typing API code manually!
    – Trav L
    Commented Feb 21, 2010 at 1:08
  • 27
    Strictly speaking, that's not msysgit's fault, but rather an issue because msys uses cmd.exe. Commented Apr 17, 2012 at 23:55
  • 1
    I upvoted your answer, but the fancy "Insert" key formatting initially made me miss the "Press Insert." part.
    – Danny
    Commented Nov 26, 2012 at 4:42
  • 32
    Fuuuuuu, I am on mac running windows, I don't have INSERT
    – kevin
    Commented Jun 24, 2013 at 15:58
  • 41
    Thanks, btw on Win 7 I have to use Shift + Ins, otherwise it says something like [(^2A]( and so forth.
    – henry
    Commented Feb 24, 2014 at 7:04
146

Aside from using the edit menu commands, you can directly paste into the git bash window using the keyboard shortcut, Insert.

7
  • 8
    No need for the Control key, just the Insert key works to paste
    – jasonpenny
    Commented Mar 3, 2010 at 2:11
  • how to cancel the paste? is there any shortcuts? Thanks!
    – Alex Chen
    Commented Apr 25, 2011 at 3:38
  • @Dan Rigby I am using latest msysgit at it doesn't work pasting. Triedied with bouth Menu->Paste and also hitting INSERT
    – Ghita
    Commented Feb 1, 2012 at 7:53
  • @Ghita it sounds like the content you want to paste isn't actually on the clipboard (or it's in a format that the shell doesn't understand). I verified locally with the latest version of msysgit that this is still functioning.
    – Dan Rigby
    Commented Mar 7, 2012 at 15:43
  • 2
    @AntiGameZ undo can be done with Ctrl-_. I believe this is all from readline utility, which emulates Emacs, the One True Editor. Commented Feb 11, 2014 at 1:35
68

It's not really a function of git, msys, or bash; every windows console program is stuck using the same cumbersome copy/paste mechanism for historical reasons. Turning on QuickEdit mode can help -- or you can install a nice alternative console like this one, and change your git bash shortcut to use it instead.

6
  • 3
    For those who want to know how to use Console2: lostechies.com/jimmybogard/2010/04/05/… Commented Nov 24, 2011 at 7:12
  • 8
    +1 for hysterical raisins. I think I will start using that from now on.
    – Steven Lu
    Commented Feb 2, 2013 at 3:08
  • With QuickEdit on this becomes pretty easy: select, Enter, Insert
    – gphilip
    Commented Feb 10, 2014 at 8:49
  • 3
    Also with quick edit mode one can paste with a click on the right mouse button. Handy!
    – lmeurs
    Commented Feb 24, 2014 at 12:28
  • 2
    Adding to what Imerus said, you dont even need to press enter for copy...select and double right click. It pastes..
    – Vishwanath
    Commented Jul 9, 2014 at 11:44
60

Copy:

Long-term solution: Click on Topleft icon > Defaults > Select "QuickEdit Mode" under "Edit Options" > Okay

Then select the text you want to copy. Press Enter

Short-term solution: Click on Topleft icon > Edit > Mark. Press Enter.

Paste:

Press Insert

(If the "QuickEdit Mode" is on, Right clicking might work too.)

2
  • 1
    This fixed it for me on Windows 7, after enabling QuickEdit Mode, I can use right click to paste :)
    – Mike R
    Commented Sep 6, 2013 at 3:45
  • +1 for the right-click as this works when using a windows VM with a mac keyboard
    – garyh
    Commented Sep 9, 2014 at 8:20
50

I'm back to Windows for the first time in a long time and this got me cursing like a docker. I finally found this:

ctrl_shift_letter_shortcuts

Enabling Ctrl+Shift+letter shortcuts got me to a Linux-like behaviour that has lowered my blood pressure. Ctrl+Shift+C/Vnow works.

1
  • 4
    I wish this would have worked for me, but it didn't. I can currently copy paste, but only using shift + insert and not the ctrl c/v or ctrl shift + c/v . tried other answers too :( Commented Sep 30, 2020 at 20:36
40

Use Shift + Insert like in linux bash

Edit: It works even in putty.

1
  • using mintty 3.4.6, quite late for this question but no need for Ctrl, Insert can do the job.
    – Luke
    Commented Aug 2, 2021 at 17:10
21

The way I do this is to hold Alt then press Space, then E and finally P.

On Windows Alt jumps to the window menu, Space opens it, E selects Edit and P executes the Paste command.

Get these correct in succession and you can paste a snippet in under 2 seconds.

2
  • 1
    This is mac friendly too (works for those of us using Windows on a mac!)
    – Alex
    Commented Jul 17, 2014 at 12:32
  • Only works for English Windows. On a French OS it would be Alt + Space then M (Modifier) and finally O (Coller).
    – Gabriel
    Commented Feb 16, 2015 at 10:09
14

enter image description here

In windows after this setting you can use ctrl + shift + v ( for windows)

1
11

This is suggested by the github help page:

clip < filename

this copies the contents of filename to the clipboard and is useful for doing things like copying your id_rsa.pub to a web form.

1
  • 1
    This is exactly what I needed! Needed to pipe from a git command into my clipboard git diff abc^1 abc -- file | clip Commented Jun 29, 2016 at 16:51
9

For paste in Git BASH CTRL + P

2
  • 1
    Thanks, that worked well and its better than use <Insert Commented Sep 16, 2014 at 17:14
  • 1
    This is the only keyboard method that worked for me on Win10. Insert (in various combinations) didn't. Quick Edit is enabled.
    – isherwood
    Commented May 10, 2016 at 14:57
7

Right click on the Git Bash shortcut and switch to the Options tab. Enable Quick Edit Mode and click OK.

Now you can use right click to paste into Git Bash, even passwords for remote push, which you can't do with Insert.

enter image description here

This also enables copy easily. Just left click and drag in the console window to select any block of text. Now right click on the selection and the text block will be copied in RAM. This is way more easier and intuitive than the other ways.

Image source: https://danlimerick.wordpress.com/2011/07/23/git-for-windows-tip-how-to-copy-and-paste-into-bash/

0
7

Windows:

  1. Right click
  2. Choose Options
  3. Choose Keys
  4. Enable Ctrl+Shift+letter shortcuts

How does it look like?

1
  • Not working for me (MINGW/GitBash on Win10), also how this should work if Ctl+C is already assigned?
    – elady
    Commented Jul 27, 2021 at 7:42
5

console2 ( http://sourceforge.net/projects/console/ ) is my go to terminal front end.

it add great features like copy/paste, resizable windows, and tabs. you can also integrate as many "terminals" as you want into the app. i personally use cmd (the basic windows prompt), mingW/msysGit, and i have shortcuts for diving directly into the python and mysql interpreters.

the "shell" argument i use for git (on a win7 machine) is:

C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"

5

Ctrl + insert did it for me in Windows.

0
4

if your intention is copy/paste comments for git commits, try set the enviromental variable EDITOR as your favorite plain-text editor (notepad, notepad++ ...) and when you will commit, don't give him the -m option and Git will open your favorite editor for copy/paste you comment

4

Get Console2. You configure it to do it multiple different ways. Works with bash or Windows command prompts.

4

You can also just right-click in the console window. Be sure (as per earlier answers) to enable both 'Edit Options' in the Properties panel (from the System menu).

3

In the properties of the console you can activate the "Quick Edit Mode" under "Edit Options", that way you can paste inside the console just right clicking. Or you can use 'Insert' as they say.

3

To copy select the text and click CTRL+INS

To paste place the cursor where you want to print

and click SHIFT+INS

For more options, on the top left click on git-bash icon

1
  • Yours is the most useful answer. Thank you. Commented Apr 7, 2021 at 20:29
3

enter image description here

  1. Right-click on the git bash.
  2. Select Options
  3. Click on the Mouse option on the left side bar.
  4. Select this highlighted option, it will be used as a paste.
  5. Don't worry, you can get the options when you do right-click on the top bar of the terminal.
1
  • 1
    Right mouse click after this configuration still triggers visual mode in VIM. holding shift key + right mouse click worked for me.
    – GO.exe
    Commented Sep 20, 2022 at 11:00
2

I was actually wondering how to do this today...and coincidentally, Phil Haack posted a tip about using posh-git (Git on powershell), which gives you tab auto-complete and a few more cool bits. I'm not going back to Git bash.

check it out

http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx

0
2

Yep, copy from somewhere else using ctrl+c and paste using INSERT. Work for me on Window 8.

1

In windows I'm not sure about copy but for paste works Ctrl+Insert. In Linux copy: CTRL+SHIFT+C, paste: CTRL+SHIFT+V

1

I use the mouse:

  1. mark
  2. right click -> copy
  3. right click -> paste
1

The solution that worked is for:

  • desktop keyboard: [shift] + [insert] keys to paste

  • laptop keyboard: [shift] + [0] keys to paste

NB: For laptops, the 0 Key at the bottom of the number pad on the upper-right corner of your keyboard will function as an Insert Key when Num Lock is turned off. That is why it is labeled with both 0 and Ins on the key itself.

1

Just copy the link. Then press SHIFT + INSERT.

2
1

For Windows 11 users- GitBash version 2.39.0.windows.2 (64-bit):

To copy it's: Ctrl + Insert

To paste it's: Shift + Insert

2
  • Did not work for me. Commented Apr 5, 2023 at 16:20
  • HP laptops don't have insert key. Commented Jun 16, 2023 at 9:12
0

COPY:Click the title bar, choose mark, then select the content you want to copy. PASTE: Copy what you want to past, focus on the bash, hit the insert key on the keyboard.

0

For users working on Windows 7, Shift + INSERT works fine.

0

I take it you're not on a Mac. Use insert key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.