I know how to select text in git bash console (for example: commit hash) use mouse, but how to do it use keyboard.
3 Answers
If your "git bash console" runs inside cmd.exe (and in typical git installation in Windows it is), then you can use cmd.exe window context menu for selecting and pasting:
- Press
alt+space
— it will bring window context menu. - Press
e
,k
— it will selectEdit
->Mark
menu option. - Now you can move your text cursor around
cmd.exe
window with arrow keys. - Select block of text by holding shift key and selecting block with arrow keys.
- Press
enter
to copy selected block of text.
You can also paste text from clipboard into console using alt+space
, e
, p
shortcut.
Note that keyboard shortcuts depend on Windows user interface language, described above commands are for English interface.

- 3,900
- 2
- 31
- 30
-
-
Better paste shortcuts are available now: https://stackoverflow.com/questions/38832230/copy-paste-in-bash-on-ubuntu-on-windows – Vadzim Sep 28 '19 at 18:58
-
2"in typical git installation in Windows it is" it is not. Git Bash runs in Mintty by default. – Krzaku Oct 10 '19 at 19:19
Hold Shift Key and first click at starting of your text then click the end of your selection

- 2,111
- 2
- 16
- 22
With none of the console, even the very good console2, you can't select and copy with the keyboard because the cursor is constrained in the prompt (except entering the menu with alt shortcuts but it's awefull!!)!
With the git bash console that use 'cmd.exe' behind the scene, you should use the the menu to copy/paste.
With console2, that's easier and all text selected is automatically copied and you just have to paste it with ctrl+v.
But if you prefer the powershell console which is quite better than 'cmd.exe', you could install post-it that add a very good git support to your powershell console...
You could also install Win command paste that permit to paste with the shortcut ctrl+v in the 'cmd.exe' console (and others)
Ps and edit: Bash is for Bourne-again shell (not 'bourne another shell like I wrote before...)

- 28,207
- 6
- 54
- 78