code

"여기에서 git-bash 열기…"컨텍스트 메뉴를 Windows 탐색기에 추가하는 방법은 무엇입니까?

codestyles 2020. 8. 24. 08:24
반응형

"여기에서 git-bash 열기…"컨텍스트 메뉴를 Windows 탐색기에 추가하는 방법은 무엇입니까?


클릭하면 현재 탐색기 폴더에서 git-bash 콘솔을 여는 컨텍스트 (일명 오른쪽 클릭) 메뉴를 Windows 탐색기에 추가하는 방법은 무엇입니까?


나는 비슷한 문제가 있었고 이것을했습니다.

1 단계 : 시작 메뉴에 "regedit"를 입력합니다.

2 단계 : 레지스트리 편집기 실행

3 단계 : 다음으로 이동HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell

4 단계 : "shell"을 마우스 오른쪽 버튼으로 클릭하고 New> Key를 선택합니다. 키 이름을 "Bash"로 지정

"쉘"을 마우스 오른쪽 단추로 클릭하고 새로 작성> 키를 선택하십시오.  키 이름을 "Bash"로 지정

5 단계 : 값을 수정하고 "Bash에서 열기"로 설정합니다. 이것은 오른쪽 클릭에 나타나는 텍스트입니다.

여기에 이미지 설명 입력

여기에 이미지 설명 입력

6 단계 : Bash 아래에 새 키를 만들고 이름을 "command"로 지정합니다. 이 키의 값을 git-bash.exe 경로로 설정하십시오.

여기에 이미지 설명 입력

여기에 이미지 설명 입력

여기에 이미지 설명 입력

레지스트리 편집기를 닫습니다.

이제 탐색기의 오른쪽 클릭 메뉴에서 옵션을 볼 수 있습니다.

기본적으로 PS Git Bash는 현재 디렉터리를 선택합니다.

편집 : 한 번의 클릭으로 접근하려면 아래 Ozesh의 솔루션을 확인하십시오.


1 단계. 바탕 화면에서 이름이 OpenGitBash.reg 인 "새로 만들기"-> "텍스트 문서"를 마우스 오른쪽 단추로 클릭합니다.

2 단계. 파일을 마우스 오른쪽 버튼으로 클릭하고 "편집"을 선택합니다.

3 단계. 아래 코드를 복사하여 붙여넣고 파일을 저장하고 닫습니다.

4 단계. 파일을 두 번 클릭하여 실행합니다.

참고 : 레지스트리에 쓰려면 관리자 권한이 필요합니다.

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.\""

결과는 다음과 같습니다.

여기에 이미지 설명 입력


다음은 Windows 설치 프로그램 -Git GUI *.reg에서 직접 Git GUI 및 Git Bash에 대한 레지스트리 내보내기 ( 파일)입니다 .

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui]
@="Git &GUI Here"
"Icon"="C:\\Program Files\\Git\\cmd\\git-gui.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_gui\command]
@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""

힘내 bash :

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\git_shell\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""

For detail about *.reg files, see “How to add, modify, or delete registry subkeys and values by using a .reg file” from Microsoft.


The easiest way is to install the latest Git from here. And while installing, make sure you are enabling the option Windows Explorer Integration.

여기에 이미지 설명 입력

Once you are done, you will get those options in whenever you right click on any folder.

여기에 이미지 설명 입력

Hope it helps.


What worked for me was almost this, but with the following REGEDIT path:
HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Directory/background/shell and here I created the key Bash, with the value of what I want the display name to be, and then created another key under this named command with the value as the path to git-bash.exe

I'm on Windows 10 and have a fresh git install that didn't add this automatically for some reason (git version 2.12.0 64bit)


You can install git for windows or Github for windows , both give you the choice while installing to add this feature to your windows explorer. You can find it here:

Github for Windows

https://windows.github.com/

Git for Windows

http://git-scm.com/


As, @Shaswat Rungta said: "I think the question is more about how to add it after the installation is over."

On my PC(Windows 7) I think that the command "Git Bash here" disappeard after I installed Visual Studio 2017.

I fixt this by downloading and installing Git again.


참고 : "Windows 용 Git를 설치할 때 상황에 맞는 메뉴 옵션은 기본적으로 '켜져 있지'않습니다. 설치하는 동안 선택해야합니다." – @nbushnell ( 내가 이것을했다 )


cmd 패치와 함께 매개 변수를 전달하는 것과 관련하여 컨텍스트 메뉴에 "Ruby로 명령 프롬프트 시작"을 추가 할 때 유사한 문제가있었습니다. 솔루션 과 유사한 절차를 따랐습니다.

Windows Registry Editor Version 5.00 

[HKEY_CLASSES_ROOT\*\shell\Cmd With Ruby]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"

[HKEY_CLASSES_ROOT\*\shell\Cmd With Ruby\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%1\"\""


[HKEY_CLASSES_ROOT\Directory\shell\bash]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"


[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%1\"\"" 

[HKEY_CLASSES_ROOT\Directory\Background\shell\bash]  
@="Cmd With Ruby"  
"Icon"="C:\\Windows\\System32\\cmd.exe"


[HKEY_CLASSES_ROOT\Directory\Background\shell\bash\command]
@="\"C:\\Windows\\System32\\cmd.exe\" \"/E:ON /K
\"C:\\Ruby25-x64\\bin\\setrbvars.cmd\"\" \"--cd=%v.\"\""

일반적 git bash here으로 디렉토리에서만 실행할 수 있으므로 디렉토리로 이동하여 이전 디렉토리를 마우스 오른쪽 버튼으로 클릭 한 다음 선택해야합니다 git bash here(물론 Windows OS에서).
참고 : 디렉토리 내의 컨텍스트 메뉴에는 git bash here옵션 이 없습니다 .


Windows 용 TortoiseGit설치 하고 상황에 맞는 메뉴에 통합을 포함 할 수 있습니다 . Windows에서 Git과 함께 작동하는 가장 좋은 도구라고 생각합니다.


나는 내 자식을 업데이트하고 "Git Bash Here"옵션을 표시했습니다.


명령 줄을 사용하여 모든 폴더에서 액세스 할 수 git있는 환경 경로 변수 (예 :)에 경로를 추가합니다 .C:\Program Files\Git\cmdgit

참고 URL : https://stackoverflow.com/questions/24386657/how-to-add-a-open-git-bash-here-context-menu-to-the-windows-explorer

반응형