Copy and Paste in Git Bash

  1. Git Bash
  2. Copy in Git Bash
  3. Paste in Git Bash

This tutorial explains copying and pasting in Git Bash using the keyboard.

Git Bash

Git is a set of command-line utility programs that run on Unix and Linux command-line environments. It is often used with a Graphical User Interface (GUI) in a Windows environment.

Git Bash provides a Git command line experience in a Windows environment. It installs both Bash and Git on Windows environments.

Copy in Git Bash

To copy the text in Git Bash using the keyboard, hold the Shift button and highlight the text or use the left/right arrows to select the text, then press Enter to copy.

In the image below, we use the ls command to list the content of the current folder, delftstack. To copy the name of file1.txt, we hold the Shift button and use the left/right arrows keys to highlight the file’s name and press Enter.

gitbash-copy

Paste in Git Bash

To paste the text in Git Bash, press Insert.

In the image below, we type the cat command, then space and press Insert to paste the name of the file we copied previously. The cat command displays the file’s content that we passed to it as the argument.

gitbash-paste

Write for us
DelftStack articles are written by software geeks like you. If you also would like to contribute to DelftStack by writing paid articles, you can check the write for us page.

Related Article - Git Copy

  • Copy Remote Branch to Local Branch in Git
  • Related Article - Git Paste

  • Copy Remote Branch to Local Branch in Git