DEV Community

Leticia Campos
Leticia Campos

Posted on

Como adicionar um menu de contexto "abrir git-bash aqui ..." ao Windows Explorer?

Segue tutorial:

1) Abra um novo bloco de notas (notepad) e salva o documento com o nome OpenGitBash.reg e o tipo como todos os arquivos

1

2) Cole o seguinte script dentro desse documento em branco:

Windows Registry Editor Version 5.00
; Open files
; Default Git-Bash Location C:\Program Files\Git\git-bash.exe

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_CLASSES_ROOT\*\shell\Open Git Bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"


[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""
Enter fullscreen mode Exit fullscreen mode

3) Clique no arquivo 2 vezes e execute:

image

4) Feito isso será exibido a opção de "Open to GitBash" ao seu windows explorer:

image

Top comments (3)

Collapse
 
caegomes profile image
CaeGomes

Excelente! Obrigado por compartilhar!

Collapse
 
stereomisterio profile image
Isadora Laviola

Você salvou a minha vida². Valeu!!

Collapse
 
advillanova profile image
Aline Villanova

Salvou a minha vida. Muito obrigada!! <3