git bash copy paste

How to copy-paste text in the Gitbash command line terminal? There’s a quick trick for each case:

  1. Copy-paste into your current command from text that is higher up in the terminal : Shift + Insert
  2. Copy-paste into your current command from text that is in another file or window

Copying from and to the terminal itself

This is for when you need to paste a value or string of text from within the GitBash terminal to the next command you’re currently editing.

  • Start typing the command and make sure the cursor is blinking in the spot where you want to paste the text you’re going to copy.
  • Scroll up with your mouse and highlight the text or string you want to copy. For instance, the first 7 characters of a commit hash.
  • With the text highlighted, press Shift + Insert
  • The text you highlighted is automatically placed in the command where you were typing from!