Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Maybe git-rebase is broken'

Tags:

git

msysgit

3rd Update

More information:

  • commands in the git-bash shell work as expected

    • in the git-bash shell, Git\bin\git.exe is called

    • Git\bin is where sh.exe lives

  • in PowerShel (or cmd, or tcc), Git\cmd\git.exe is called

  • even after adding Git\bin to the PATH (after Git\cmd), the scripts don't work

Very frustrating...

2nd Update

It appears all the git commands implemented by .exe files work: git-fetch.exe, git-merge.exe, git-push.exe, etc.

It appears all the commands implemented as scripts to not work:

Git\libexec\git-core\git-pull
Git\libexec\git-core\git-rebase

etc. So, whatever git.exe is calling to run the libexec\git-core scripts appears to be farkled...

1st update

Here we go again... "git pull" has gone sideways (pretty sure it was working yesterday):

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://[email protected]':
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]>

I have uninstalled/reinstalled msysgit. I get the same results in PowerShell and cmd.exe.

Original Post

[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?

Just reinstalled mSysGit on Win7x64. The PATH now includes:

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

Any ideas on what's going wrong? I searched on GitHub, but didn't find any info there...

like image 321
Number8 Avatar asked Jun 27 '13 15:06

Number8


People also ask

What is a git rebase?

What is git rebase? Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow.

Does rebase create new commits?

The Rebase Option But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.

How do I cancel rebase?

You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called. You can run git rebase --skip to completely skip the commit.

How do I use git rebase command?

You will have to resolve any such merge failure and run git rebase --continue . Another option is to bypass the commit that caused the merge failure with git rebase --skip . To check out the original <branch> and remove the .git/rebase-apply working files, use the command git rebase --abort instead.


2 Answers

I know this question is quite old but I ran into a similar problem. It may help someone else. To avoid problems with MinGW make, I had to rename sh.exe to ensure it was not in the path. After that, commands like git rebase were not working anymore giving the same error as in the question:

fatal: 'rebase' appears to be a git
command, but we were not   able to execute it.
Maybe git-rebase is broken?

As soon as I restored sh.exe, git rebase restarted to work.

like image 152
osechet Avatar answered Oct 19 '22 23:10

osechet


Can you find C:\Program Files (x86)\Git\libexec\git-core\git-rebase which is a shell script? It should be there in order to work.

like image 33
linquize Avatar answered Oct 19 '22 23:10

linquize