更多信息:
git-bash shell中的命令按预期工作
在git-bash shell中,调用Git\bin\git.exe
Git\bin是sh.exe所在的地方
在PowerShel(或cmd或tcc)中,调用Git\cmd\git.exe
即使将Git\bin添加到PATH(在Git\cmd之后),脚本也不起作用
很沮丧......
看来.exe文件实现的所有git命令都有效:git-fetch.exe,git-merge.exe,git-push.exe等.
它显示为脚本来实现的所有命令不工作:
Git\libexec\git-core\git-pull
Git\libexec\git-core\git-rebase
Run Code Online (Sandbox Code Playgroud)
等等,无论git.exe调用什么运行libexec\git-core脚本似乎都被吓倒了......
我们再来一次......"git pull"横向走了(很确定它昨天正常工作):
I:\Work\bitbucket\PluralSight\proj1 [work2]> git stat
On branch work2 nothing to commit, working directory clean
I:\Work\bitbucket\PluralSight\proj1 [work2]> git fetch
Password for 'https://user@bitbucket.org':
I:\Work\bitbucket\PluralSight\proj1 [work2]> git pull
*fatal: 'pull' appears to be a git command, but we
were not able to execute it. Maybe git-pull is broken?*
I:\Work\bitbucket\PluralSight\proj1 [work2]>
Run Code Online (Sandbox Code Playgroud)
我已经卸载/重新安装了msysgit.我在PowerShell和cmd.exe中得到相同的结果.
[work]> git rebase master
fatal: 'rebase' appears to be a git
command, but we were not able to execute it.
Maybe git-rebase is broken?
Run Code Online (Sandbox Code Playgroud)
刚刚在Win7x64上重新安装了mSysGit.PATH现在包括:
C:\Program Files (x86)\Git\cmd
C:\Program Files (x86)\Git\bin
Run Code Online (Sandbox Code Playgroud)
什么出问题的任何想法?我在GitHub上搜索过,但没有找到任何信息......
我知道这个问题已经很老了,但我遇到了类似的问题。它可能会帮助别人。为了避免 MinGW make 出现问题,我必须重命名sh.exe以确保它不在路径中。在那之后,像这样的命令git rebase不再工作,给出与问题相同的错误:
fatal: 'rebase' appears to be a git
command, but we were not able to execute it.
Maybe git-rebase is broken?
Run Code Online (Sandbox Code Playgroud)
我一恢复sh.exe,就git rebase重新开始工作。