How do you copy and paste into Git Bash

GitWindows XpCopy PasteMsysgit

Git Problem Overview


I'm using msysgit running on Windows XP.

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

Git Solutions


Solution 1 - Git

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/

Solution 2 - Git

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

Solution 3 - Git

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.

Solution 4 - Git

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.)

Solution 5 - Git

Use Shift + Insert like in linux bash

Edit: It works even in putty.

Solution 6 - Git

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.

Solution 7 - Git

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.

Solution 8 - Git

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.

Solution 9 - Git

For paste in Git BASH CTRL + P

Solution 10 - Git

enter image description here

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

Solution 11 - Git

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/

Solution 12 - Git

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"

Solution 13 - Git

Ctrl + insert did it for me in Windows.

Solution 14 - Git

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

Solution 15 - Git

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

Solution 16 - Git

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).

Solution 17 - Git

Windows:

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

How does it look like?

Solution 18 - Git

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.

Solution 19 - Git

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

Solution 20 - Git

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

Solution 21 - Git

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

Solution 22 - Git

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

Solution 23 - Git

I use the mouse:

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

Solution 24 - Git

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.

Solution 25 - Git

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

Solution 26 - Git

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

Solution 27 - Git

Here are a lot of answers already but non of them worked for me. Fyi I have a Lenovo laptop with win10 and what works for me is the following:


Paste = Shift+fn+prt sc


Copy = Shift+fn+c

Solution 28 - Git

I also go through the same problem, git bash does not support tradition method to copy and paste in windows but you can simply copy and paste in single command

SHIFT+fn+INSERT

Solution 29 - Git

If you click at the icon on the upper left corner, a drop-down menu will appear, and you can find the option to copy/paste from there.

Solution 30 - Git

on my keyboard insert is located on the same key as a Printscreen. unfortunately, ctrl + ins doesn't work for me , so i descoved the following working combinations for me:

FN + CTRL + PRT SC - for copy

FN + SHIFT + PRT SC - for insert

Solution 31 - Git

If you want to paste press:

shift + insert

Solution 32 - Git

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.

Solution 33 - Git

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.

Solution 34 - Git

MacBook pro doesnt have an ins key. Use FN + ENTER to paste

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTrav LView Question on Stackoverflow
Solution 1 - GitAmberView Answer on Stackoverflow
Solution 2 - GitDan RigbyView Answer on Stackoverflow
Solution 3 - GithobbsView Answer on Stackoverflow
Solution 4 - GitHaoQi LiView Answer on Stackoverflow
Solution 5 - GitAnatoly MironovView Answer on Stackoverflow
Solution 6 - GitDavid CarboniView Answer on Stackoverflow
Solution 7 - GitiKlsRView Answer on Stackoverflow
Solution 8 - GitTim DView Answer on Stackoverflow
Solution 9 - GitEhigie PaulView Answer on Stackoverflow
Solution 10 - GitSanjib DebnathView Answer on Stackoverflow
Solution 11 - Gitdatasn.ioView Answer on Stackoverflow
Solution 12 - GitxeroView Answer on Stackoverflow
Solution 13 - GitPatricia HeimfarthView Answer on Stackoverflow
Solution 14 - GitLucasView Answer on Stackoverflow
Solution 15 - GitJon KrugerView Answer on Stackoverflow
Solution 16 - GitJohn KelleherView Answer on Stackoverflow
Solution 17 - GitAlex MIrView Answer on Stackoverflow
Solution 18 - GitepergoView Answer on Stackoverflow
Solution 19 - GitGanesh Chowdhary SadanalaView Answer on Stackoverflow
Solution 20 - GitGR7View Answer on Stackoverflow
Solution 21 - GitHoaPhanView Answer on Stackoverflow
Solution 22 - GitКирилл ВасинView Answer on Stackoverflow
Solution 23 - GitHindView Answer on Stackoverflow
Solution 24 - GitLizzyView Answer on Stackoverflow
Solution 25 - GitAbdullah KhanView Answer on Stackoverflow
Solution 26 - GitHoaPhanView Answer on Stackoverflow
Solution 27 - GitMik_AView Answer on Stackoverflow
Solution 28 - GitAvnish NishadView Answer on Stackoverflow
Solution 29 - GitmarkView Answer on Stackoverflow
Solution 30 - GitNadiia ZwyssigView Answer on Stackoverflow
Solution 31 - GitPiggyAwesomeView Answer on Stackoverflow
Solution 32 - GitOshanedesignView Answer on Stackoverflow
Solution 33 - GitKasthuri ShravankumarView Answer on Stackoverflow
Solution 34 - GitBoruneView Answer on Stackoverflow