indojin
indojin

Reputation: 149

Is there a way to copy text in git bash (on Windows) using just the keyboard?

I want to copy text, either -

simply by navigating the cursor and selecting the text using only the keyboard. I do not want to use the mouse at all.

  1. Is there any way to do this?
  2. If impossible, is there any way to do this with minimal use of the mouse?

Example use case - copying the name of a branch, or a commit ID (from a previous git log or git branch) and then pasting it in a git command for switching to it.

Upvotes: 4

Views: 4294

Answers (4)

Amey Joshi
Amey Joshi

Reputation: 123

I discovered an answer on another forum. One just has to enable to Ctrl + Shift + Letter keys from the bash terminal's options. One can then use Ctrl + Shift + C to copy and Ctrl + Shift + V to paste.

Upvotes: 1

Adiatma
Adiatma

Reputation: 1

You can copy but can't paste text or number on Windows.

Just copy with shortcut ctrl + v. After copying, press right mouse click to paste wherever you want.

Paste will reset when press left mouse button.

Upvotes: -1

Oshanedesign
Oshanedesign

Reputation: 39

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.

Upvotes: 1

LF-DevJourney
LF-DevJourney

Reputation: 28529

You can check the shortcut by

with keys: > options > keys > shortcuts

or

with mouse > options > mouse > mouse functions

Upvotes: 1

Related Questions