4

作为便携式应用程序的粉丝(即使在我的主工作站上运行),我使用msysGit的便携式版本,但是,它不安装 shell 挂钩、环境变量、GUI 设置、图标等。我想保留我的C:\和将应用程序安装到我的雇主提供的原始干净映像中,这样每当他们提供新的 Windows 映像时,我就不必重新安装所有便携式应用程序(包括 Git)。

是否有任何可用的脚本允许便携式版本简单地通过 shell 钩子(此处为 Git Bash /此处为 Git GUI)和图标(但未安装)“注册”?

换个方式问,如果我安装完整版的话,D:\PortableApps\Git在集中所有文件存储方面,它在功能上是否等同于便携版?

4

2 回答 2

3

将以下内容剪切并粘贴到文件中(比如 install.reg)并双击它。

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui] @="Git &GUI Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui\command] @="\"D:\PortableApps\Git\bin\wish.exe\" \"D:\PortableApps\Git\libexec\git-core\git -gui\" \"--工作目录\" \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell] @="Git Ba&sh Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell\command] @="wscript \"D:\PortableApps\Git\Git Bash.vbs\" \"%1\""

使用以下目标创建一个名为 Git Bash.lnk 的快捷方式:

C:\WINDOWS\system32\cmd.exe /c ""D:\PortableApps\Git\bin\sh.exe" --login -i"

您的便携式 Git 现在已在 Windows shell 中注册。

于 2011-02-28T06:46:24.293 回答
1

我的 MsysGit 安装在目录“f:\git177”中。所以我在 windows 2003sp2 中的 githere.reg 文件是:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\git_gui]
@="Git &GUI Here"

[HKEY_CLASSES_ROOT\Directory\shell\git_gui\command]
@="f:\\Git177\\bin\\wish.exe \"f:\\Git177\\libexec\\git-core\\git-gui\" \"--working-dir\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\git_shell]
@="Git Ba&sh Here"

[HKEY_CLASSES_ROOT\Directory\shell\git_shell\command]
@="wscript \"f:\\git177\\Git Bash.vbs\" \"%1\""
于 2011-10-30T08:16:20.460 回答