git bash Windows 바로 가기를 수정할 수 없습니다.
Windows 7에서 Git Bash Here 셸 확장 명령 창의 설정 (예 : 너비, 높이 및 글꼴)을 변경하고 싶습니다. 하지만 이렇게하면 "바로 가기를 수정할 수 없습니다"라는 오류가 발생합니다.
"관리자 권한으로 실행 ..."을 사용하여 시작 메뉴에서 Git Bash의 바로 가기를 수정할 수 있습니다. 이것은 작동하지만 시작 메뉴에서 열린 Bash 창에서만 작동합니다. 그것은 하지 않습니다 "여기 힘내 강타"를위한 쉘 확장 작업을하고 마우스 오른쪽 단추로 클릭하고 상황에 맞는 메뉴에서 옵션 ... "관리자 권한으로 실행"전혀 없다.
어떻게하나요?
아이콘을 마우스 오른쪽 버튼으로 클릭하고 "관리자 권한으로 실행"을 선택하여 관리자 권한으로 git bash를 실행하면 설정을 변경하고 유지하도록 할 수 있습니다.
관리자 세션을 닫은 다음 일반 사용자로 다시 열어이를 확인할 수 있습니다.
나는 기본값을 설정하기 위해 이것을 한 다음 그때부터 일반 사용자로 git을 사용했습니다.
편집 : 최신 msysgit 버전을 사용 하고 sebastien.b가 업데이트 된 솔루션을 https://stackoverflow.com/a/7216120/104783에 게시 한 경우 내 대답이 오래 되었습니다.
그것은 말한다
해결 방법은
Git Bash.vbs
스크립트 를 편집하고 sh.exe 대신 링크를 다시 실행하도록하는 것입니다. 이 줄을 찾으십시오.Dim bash : bash = fso.BuildPath(gitdir, "bin\sh.exe")
다음 줄로 바꿉니다.
Dim bash : bash = fso.BuildPath(gitdir, "Git Bash.lnk")
andrej351은 또한 좋은 알림이 있습니다.
또한 설정을 유지하려면 드롭 다운 메뉴에서 "속성"대신 "기본값"을 선택하는 것을 잊지 마십시오.
불행하게도, 사용자가 제공하는 허용 대답 스파크 또는 bentayloruk는 (적어도 자식 1.7.6 기준) 더 이상 작동하지 않습니다. Git Bash.vbs
"에 의해 트리거 스크립트 여기 힘내 배쉬 "는 실행되지 않습니다 Git Bash
더 이상 바로 가기를. bin/sh.exe
대신 Git 설치 디렉터리에서 실행 파일 을 실행하는 임시 바로 가기 (.lnk)를 생성합니다 . 해당 실행 파일 (sh.exe) 또는 Git Bash 바로 가기의 속성 (글꼴, 색상)을 수정하는 것은 도움이되지 않습니다.
해결 방법은 Git Bash.vbs
스크립트 를 편집하고 sh.exe 대신 링크를 다시 실행하도록하는 것입니다. 이 줄을 찾으십시오.
Dim bash : bash = fso.BuildPath(gitdir, "bin\sh.exe")
다음 줄로 바꿉니다.
Dim bash : bash = fso.BuildPath(gitdir, "Git Bash.lnk")
업데이트 : 일부 의견 및 기타 답변에 따르면이 답변은 이전 버전에만 관련이 있습니다. 1.7.6 이전 버전 일 수 있습니다.
전체 지침
다음을 수행하여 Git Bash Here 컨텍스트 메뉴를 사용할 때 적용되는 설정을 수정할 수 있습니다 .
- Windows 용 Git 설치 폴더를 엽니 다. 예 :
C:\Program Files (x86)\Git
. - Git Bash 바로 가기 파일을 마우스 오른쪽 버튼으로 클릭하고 관리자 권한으로 실행을 선택 합니다.
- Windows 명령 프로세서에 컴퓨터를 수정할 수있는 권한을 부여할지 묻는 메시지가 표시되면 예를 클릭 합니다 (그렇지 않으면 변경 사항이 유지되지 않음).
- 원하는대로 속성을 수정 한 다음 (제목 표시 줄을 마우스 오른쪽 단추로 클릭하고 속성을 클릭) 창을 닫습니다.
추가 세부 사항
이것은 Git Bash Here 쉘 확장 메뉴 항목을 클릭하면 명령이 실행 되기 때문에 작동 합니다 wscript "C:\Program Files (x86)\Git\Git Bash.vbs" "%1"
. 이것은 레지스트리 키에 지정됩니다 HKEY_CLASSES_ROOT\Directory\shell\git_shell\command
. 이 vbs 파일은 현재 디렉터리를 설정 한 다음 Git Bash 바로 가기 를 실행합니다 . 이 바로 가기의 설정을 변경하면이 바로 가기가 실행될 때 항상 사용됩니다 (관리자 여부에 관계없이).
위의 덕분에 내가 한 것처럼 Git Bash 컨텍스트 메뉴를 관리자로 실행하는 방법을 찾고있는 사람이 여기에 올 경우 (어떤 이유로 든),이 작업을 수행하는 데 필요한 수정 된 단계는 다음과 같습니다.
- Git 디렉토리 (예 : C : \ Program Files (x86) \ Git)에서 대상 ' "C : \ Program Files (x86) \ Git \ bin \ sh.exe"를 사용하여 "Git Bash"라는 바로 가기를 만듭니다. --login- 나는'
- 위에서 언급 한대로 Git Bash.vbs를 편집하여 대상을 "Git Bash.lnk"로 설정합니다.
- Git Bash.vbs에서 'link.Arguments = "--login -i"'줄을 제거합니다.
저를 올바른 방향으로 밀어 주신 위의 모든 분들께 감사드립니다.
추신, 이것은 Windows 7의 Git-1.9.0-preview20140217입니다.
Windows 레지스트리에서 직접 셸의 컨텍스트 메뉴 처리기를 편집 할 수 있습니다. 찾고있는 것은 아마도 다음 분기 중 하나에있을 것입니다.
- HKCR \ 디렉터리 \ 쉘 \
- HKCR \ Directory \ ShellEx \ ContextMenuHandlers \
- HKCR \ 폴더 \ 쉘 \
- HKCR \ Folder \ ShellEx \ ContextMenuHandlers \
- HKCR \ AllFilesystemObjects \ shell \
- HKCR \ AllFilesystemObjects \ shellex \ ContextMenuHandlers \
여기에서 할 수있는 작업을 설명 하는 긴 기사 가 있습니다. 살펴볼 위치에 대한 추가 팁 은 이 기사의 후반부를 참조하십시오 .
C : \ Program Files (x86) \ Git 또는 git을 설치하고 git bash 바로 가기를 편집 할 때마다 크기는 레이아웃 탭에 있습니다.
Git 2.8.2 (64 비트)에서 비슷한 문제가 발생하여 Git Bash에 대한 .exe 아이콘이 생겼습니다 (셸에서도 발생할 수 있음). 내가 한 일은 다음과 같습니다.
- Git Bash 열기
- 열린 작업 표시 줄 아이콘을 마우스 오른쪽 버튼으로 클릭합니다.
- Git Bash를 마우스 오른쪽 버튼으로 클릭하십시오.
- 속성
- 대상 및 시작 필드가 올바른 경우 확인 하십시오. 광산을 대상으로 한 프로그램 파일 (86) ,하지만 내 힘내에 설치되어있는 프로그램 파일
- Git Bash를 저장하고 다시 엽니 다.
왜 이런 일이 발생 했습니까?
It was because I already had Git on my Windows, which was a 32 bits version, and then I - without knowing about the incompatibility - updated my Git to a newer version running in 64 bits.
Another way to resolve this would be by totally reinstalling it.
You could try freewares like Default Programs Editor or Context Menu Editor, and see if that allows you:
- to edit properly the shortcut,
- or to define a new shortcut (which behaves like you want) and register that shortcut in the contextual menu.
Check out a modified "Git Bash.vbs" that uses the new method for UNC paths but the old method for local paths.
http://groups.google.com/group/msysgit/browse_thread/thread/0603d9565a988d48?pli=1
The problem I was having with Sebastien's solutions was that the bash path was always the parent of the folder I selected, which I found annoying.
This solution helped me to change font size:
Replace Target of Git Bash link with the following:
%ComSpec% /c "C:\Program Files (x86)\Git\bin\sh.exe" --login -i
Locate Git Bash link on the start menu, right-click and Run as Administrator.
Modify Properties of the opened console, not Defaults. Set whatever font you like. I prefer Consolas 28 since I'm pretty blind :)
You are done. You can close the console and run it again as regular user; the font size should be of your choice.
The instructions above did not work for me. I created a shortcut to cmd.exe in my taskbar, set it to run as Administrator, and told it to run git shell.
- open %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
- Right-click in the directory and choose New -> Shortcut
In the text field where it says "Type the location of the item", enter:
C:\Windows\System32\cmd.exe /c "%USERPROFILE%\Desktop\GIT Shell.lnk"
Choose a name for the shortcut and save.
- Right-click the shortcut you just saved, click the Advanced... button, and then mark the checkbox for Run as Administrator.
I chose the default install location for the Git Shell shortcut in case it gets updated in a future release, but you can put it anywhere to make this work today - just be sure to update the command for your shortcut with the new location.
Now you can launch a command prompt as Administrator with all the Git Shell paths with one click in your taskbar.
Later versions, such as Git for Windows v2.7.2 (64 bit) don't use a VBS file so I modified the registry to run the shortcut via cmd.exe. It works, but you have to manually close the cmd window when it opens, which isn't too onerous.
The Registry key to change is
HKEY_CLASSES_ROOT / Directory / shell / git_shell / command
You will find default value should be something like:
"C:\Program Files\Git\git-bash.exe" "--cd=%1"
I changed it to
cmd.exe /k ""C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Git\Git Bash.lnk" "--cd=%1""
The location of the lnk file may be different for you, and note also the double quoting needed around the command.
BTW - I use Git Bash for running my Ember CLI build and serve commands. Being able to run it with elevated permissions by setting the lnk to run as admin is useful because it improves performance significantly.
On windows 7, simply right click on the program, then choose properties
and enter a new shortcut. You will need administrator rights.
참고URL : https://stackoverflow.com/questions/2621281/unable-to-modify-git-bash-windows-shortcut
'IT TIP' 카테고리의 다른 글
C #을 네이티브로 컴파일 하시겠습니까? (0) | 2020.11.20 |
---|---|
Django를 다른 get 변수로 페이지 매김하는 방법은 무엇입니까? (0) | 2020.11.20 |
GIT_WORK_TREE는 무엇입니까?이 ENV 변수를 설정할 필요가없는 이유는 무엇입니까? (0) | 2020.11.20 |
파이썬 JSON은 첫 번째 수준에서만 키를 얻습니다. (0) | 2020.11.20 |
LINQPad는 다른 클래스 (예 : LINQ in Action 샘플의 Books)를 어떻게 참조합니까? (0) | 2020.11.20 |