DEV Community

Leticia Campos
Leticia Campos

Posted on

7 3

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

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (5)

Collapse
 
ow_lana profile image
Fernando Lana de Oliveira

Até criei uma conta pra agradecer, muito obrigado Leticia <3

Collapse
 
jhuliani profile image
Jhuliani Cristina

Muito bom, depois que atualizei pro w11 não estava mais mostrando essa opção e com seu script funcionou certinho. Obrigada

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs