Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: 'rebase' is not a git command. See 'git --help'

I set up github for mac
and now I am trying to use the git command from the terminal.

If I try to run the git rebase command I get the following message

> cd /Applications/GitHub.app/Contents/Resources/git/bin
> git rebase
git: 'rebase' is not a git command. See 'git --help'.

>git --help
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]

The most commonly used git commands are:
...
rebase     Forward-port local commits to the updated upstream head
....

So as you can see from the help output the option rebase is present.
What is wrong in my git?

git --version
git version 1.7.8.2
like image 506
user1328847 Avatar asked Apr 12 '12 14:04

user1328847


2 Answers

For me, I found that to fix this error message ("'rebase' is not a git command") I needed to set up Git "exec-path", either via command-line for one-shot use, or better via environment variable:

export GIT_EXEC_PATH=/PATH/TO/git/libexec/git-core
like image 174
akavel Avatar answered Oct 04 '22 04:10

akavel


You're using the Git build that comes with GitHub for Mac. They (GitHub, that is) probably modified the binary to remove features that GitHub for Mac doesn't use.

You should really install your 'own' Git. I recommend using Homebrew: Link

like image 39
Wander Nauta Avatar answered Oct 04 '22 02:10

Wander Nauta