集成 Git-For-Windows 后,我在 MSYS2 启动时收到此错误:bash: create-shortcut.exe: command not find
我安装了 msys2
,然后通过应用 这个简单的过程。
执行此操作后,当我双击 msys2
桌面图标时,我收到此错误:
bash: create-shortcut.exe: command not found
bash: create-shortcut.exe: command not found
jdoe@msys2$
我可以看到上述错误的根源。
上述过程创建了这个新脚本 - /etc/profile.d/git-sdk.sh
- 它尝试运行 create-shortcut.exe
命令;但是(就像脚本一样)我找不到 create-shortcut.exe
在哪里。
有谁知道 create-shortcut.exe
来自哪里(MSYS2
、MS-WINDOWS
),或者它可能位于何处?或者甚至知道解决这个问题的方法是什么? =:)
I installed msys2
, and then integrated the installation of Git-For-Windows
within that msys2
environment, by applying this simple procedure.
After doing so, I'm getting this error when I double-click the msys2
desktop icon:
bash: create-shortcut.exe: command not found
bash: create-shortcut.exe: command not found
jdoe@msys2$
I can see where the above error originates.
The aforementioned procedure created this new script - /etc/profile.d/git-sdk.sh
- which attempts to run the create-shortcut.exe
command; but (like the script) I can't find where create-shortcut.exe
is.
Does anyone know where that create-shortcut.exe
comes from (MSYS2
, MS-WINDOWS
), or where it might be located? Or perhaps even know what the fix for this is? =:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
谢谢评论者。
这是一个错误,要么是因为引用的命令未包含在包中,要么是因为该命令不在脚本的
PATH
中。我将在GitHub
项目中为此提交一个问题。特别感谢
@HolyBlackCat
指出该过程不是必需的,因为git(1)
已经在MSYS2
的默认存储库中可用。 (我是MSYS2
的新手,因为我获得的是Windows
环境,而不是Linux
)。因此,我最终取消了该过程并安装了本机存储库版本,效果很好。但是,如果您确实想保留该过程提供的版本 - 因为它确实提供的不仅仅是
git(1)
命令(例如,它有一个SDK< /code> 也)——然后您可以简单地找到并安全地注释掉
/etc/profile.d/git-sdk.sh
RC 脚本中的有问题的部分,该脚本的唯一目的是创建Windows
桌面图标。希望这对其他人有帮助。Thank you to the commenters.
It's a bug, either because the referenced command wasn't included in the package, or because the command is not in the script's
PATH
. I'll file an issue in theGitHub
project for it.Thank you particularly to
@HolyBlackCat
for pointing out that the procedure wasn't necessary sincegit(1)
is already available inMSYS2
s default repositories. (I'm new toMSYS2
because I was provided aWindows
environment instead ofLinux
). So, I ended up backing out the procedure and installing the native repository version instead, which works well.However, if you did want to keep the version provided by the procedure -- because it does, indeed, offer more than just the
git(1)
command (e.g., it has anSDK
too) -- then you can simply locate and safely comment-out the offending section in the/etc/profile.d/git-sdk.sh
RC script, whose only purpose is to create aWindows
desktop icon. Hopefully this helps others.实际上,当您启动
C:\git-sdk-64\git-bash.exe
时,不会弹出错误,它会在桌面上创建自己作为快捷方式,这就是这些行的作用。您可能尝试使用带有 init 命令C:\git-sdk-64\usr\bin\bash.exe --login -i
和图标C:\git 的 Windows 终端-sdk-64\mingw64\share\git\git-for-windows.ico
。编辑
/etc/profile.d/git-sdk.sh
不是最好的主意。最好调整用户的.bash_profile
以将PATH
包含到create-shortcut.exe
,但将export PATH="/mingw64/bin:$PATH"
进入文件并没有帮助,因为create-shortcut.exe
被调用得更早。似乎
/etc/profile
加载git-sdk.sh
并且您跳过的git-bash.exe
包装器正在设置PATH我认为 ="/mingw64/bin:$PATH
让create-shortcut.exe
工作。幸运的是,当
git-sdk.sh
被获取时PATH
已包含/usr/local/bin
,因此您可以通过管理 shell 将 exe 符号链接到该路径:现在,错误在任何终端中都消失了,而无需触及任何 shell 脚本。
Actually the error will not pop up when you launch
C:\git-sdk-64\git-bash.exe
and it will create itself as shortcut on the desktop, that's what the lines do. You probably try to use the Windows terminal with the init commandC:\git-sdk-64\usr\bin\bash.exe --login -i
and the iconC:\git-sdk-64\mingw64\share\git\git-for-windows.ico
.Editing
/etc/profile.d/git-sdk.sh
isn't the best idea. It would've been better to adjust the user's.bash_profile
to include thePATH
tocreate-shortcut.exe
, but puttingexport PATH="/mingw64/bin:$PATH"
into the file doesn't help, becausecreate-shortcut.exe
is called even earlier.It seems
/etc/profile
loadsgit-sdk.sh
and thegit-bash.exe
wrapper that you skip is settingPATH="/mingw64/bin:$PATH
to makecreate-shortcut.exe
work, I think.Luckily by the time
git-sdk.sh
is sourced thePATH
already contains/usr/local/bin
, so you can just symlink the exe to that path via an Admin shell:Now the error is gone in any Terminal without touching any shell scripts.