【问题标题】:'Maybe git-rebase is broken''也许 git-rebase 坏了'
【发布时间】:2013-06-27 15:03:52
【问题描述】:

第三次更新

更多信息:

  • 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

等等。因此,无论 git.exe 调用什么来运行 libexec\git-core 脚本似乎都被 farkled...

第一次更新

我们又来了……“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]>

我已经卸载/重新安装了 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?

刚刚在 Win7x64 上重新安装了 mSysGit。 PATH 现在包括:

C:\Program Files (x86)\Git\cmd  
C:\Program Files (x86)\Git\bin  

对出了什么问题有任何想法吗?我在 GitHub 上搜索,但没有找到任何信息...

【问题讨论】:

  • 您在那里使用哪个命令外壳?电源外壳?我怀疑你的系统上可能有另一个 sh.exe,它正在被使用,而不是 Git for Windows 附带的那个。如果是这样,请尝试删除 Git\bin 的路径,然后使用 Git\cmd。 Git\cmd\git.exe 包装器设置环境,以便 git 程序首先找到 git 附带的实用程序。
  • 感谢您的回复。但是,Git\cmd 位于 Git\bin 之前。无论如何我都会尝试删除 Git\bin。
  • git.exe 是外部的:C:\Program Files (x86)\Git\cmd\git.exe。 PowerShell 和 cmd.exe(和 tcc.exe)的结果相同。

标签: git msysgit


【解决方案1】:

我知道这个问题已经很老了,但我遇到了类似的问题。它可能会帮助其他人。 为了避免 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?

我一恢复sh.exegit rebase就重新开始工作了。

【讨论】:

    【解决方案2】:

    你能找到C:\Program Files (x86)\Git\libexec\git-core\git-rebase 这是一个shell 脚本吗? 它应该在那里才能工作。

    【讨论】:

    • 是的,(C:\Program Files (x86)\Git\libexec\git-core\git-rebase) 存在。 “git rebase”(和相关操作)正在一台计算机上工作,但不是另一台;试图弄清楚有什么不同。奇怪,因为我很确定我使用了相同的安装过程。
    • 我发现路径变量中缺少路径“C:\Program Files\Git\bin”的条目。显然我的路径变量已达到极限,所以我什至无法手动输入。我最终创建了一个单独的变量......将其命名为 GITA 并将该变量添加到路径条目中。我添加路径 git/binis 的原因是 sh.exe 所在的位置。显然这是缺少的。
    【解决方案3】:

    不确定(它没有解释为什么 git 在我的一台计算机上运行,​​但在另一台计算机上却没有),但它确实提供了一些关于可能发生的情况的见解:https://groups.google.com/forum/#!topic/msysgit/VrQLAgQwJHM

    我已经安装了便携版本,将其添加到我的路径中,git 再次按预期工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-07
      • 1970-01-01
      • 1970-01-01
      • 2011-07-12
      相关资源
      最近更新 更多