无法修改 git bash Windows 快捷方式 [英] Unable to modify git bash Windows shortcut

查看:21
本文介绍了无法修改 git bash Windows 快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

  1. Right-click C:Program FilesGitgit-bash.exe (Git for Windows)
  2. Click Properties
  3. Click the Compatibility tab in the Properties dialog
  4. Check the "Run This Program As An Administrator" check box
  5. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆