无法修改 git bash Windows 快捷方式 [英] Unable to modify git bash Windows shortcut
问题描述
Under Windows 7 I'd like to change the settings for the Git Bash Here shell extension command window, e.g. width, height and font. But when I do this, I get an error "Unable to modify the shortcut".
I can modify the shortcut for Git Bash in the Start menu by using "Run as administrator..." This works, but only for Bash windows opened from the Start menu. It doesn't work for the "Git Bash Here" shell extension and there's no "Run as administrator..." option on right-click context menu.
How do you do it?
2020 Update
KVN posted an update for Windows 10
This one seems to be simplier and works well for me on the latest Git.
- Right-click C:Program FilesGitgit-bash.exe (Git for Windows)
- Click Properties
- Click the Compatibility tab in the Properties dialog
- Check the "Run This Program As An Administrator" check box
- Click OK button
Older
If you run git bash as administrator by right clicking on its icon and selecting "Run As Administrator" you will be able to change your settings and have them persist.
You can verify this by closing the admin session then reopening as a normal user.
I did this to set the defaults then just used git as a normal user from then on.
Edit: My answer is outdated if you're using the most recent msysgit version and sebastien.b posted the updated solution with - https://stackoverflow.com/a/7216120/104783
It states
The fix is to edit the
Git Bash.vbs
script and have it execute the link again, instead of sh.exe. Look for this line:
Dim bash : bash = fso.BuildPath(gitdir, "binsh.exe")
and replace it with this line:
Dim bash : bash = fso.BuildPath(gitdir, "Git Bash.lnk")
andrej351 also has a good reminder
Also, don't forget to select "Defaults" instead of "Properties" from the drop down menu in order to have the settings persisted
这篇关于无法修改 git bash Windows 快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!