IDE/Git

git-bash-here 작동 방법(feat. Windows)

블로그 주인장 2023. 10. 28.

Open git-bash-here 작동 방법

현재 탐색기 폴더에서 git-bash 콘솔을 열 수 있는 windows 탐색기(오른쪽 마우스) 메뉴를 추가하는 방법을 알아보겠습니다. 

 

 

배치 파일을 이용한 설정


  1. 해당 배치파일을 다운로드 받는다.
  2. 관리자 권한으로 해당 배치파일을 실행한다.

OpenGitBash.bat
0.00MB

 

📌 OpenGitBash.bat 파일이 열리지 않는 경우


  • 해당 내용을 복사하여 메모장을 실행한다
  • .txt -> .bat 파일 형식으로 변경하여 실행한다.
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.\""

 

레지스트리를 이용한 설정


1. 시작 메뉴에 'regedit' 입력 (레지스트리 편집기 실행)

 

2. HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell 검색

 

2- 1. 해당 키(폴더)가 없으면 shell 생성

 

3. "shell"을 마우스 오른쪽 버튼으로 클릭하고 새로 만들기 > 키를 선택합니다. 키 이름을 "Bash"로 지정한다.

4. "Bash"을 마우스 오른쪽 버튼으로 클릭하고 새로 만들기 > 키를 선택합니다. 키 이름을 "command"로 지정한다.

 

5. 해당 카테고리를 마우스 오른쪽 버튼을 클릭하여 데이터를 수정하고 "open in Bash"로 설정합니다.

 

6. 해당 카테고리를 마우스 오른쪽 버튼을 클릭하여 데이터를 수정하고, 이 키의 값을 git-bash.exe 경로로 설정하세요.

 - 본인 컴퓨터에 설치되어 있는 git의 경로를 찾아서 경로 + git-bash.exe 값을 추가해준다.

 

7. 탐색기에서 오른쪽 클릭 메뉴에서 git을 사용할 수 있는 옵션이 추가되는 것을 확인 가능하다.

 

참고


https://malgun-gothic.tistory.com/38

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

반응형

댓글