我设置了github for mac
现在我正尝试从终端使用 git 命令。
如果我尝试运行 git rebase
命令,我会收到以下消息
> 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
....
因此,正如您从帮助输出中看到的,存在选项 rebase。
我的 git 有什么问题?
git --version
git version 1.7.8.2
最佳答案
对我来说,我发现要修复此错误消息(“'rebase' 不是 git 命令
”)我需要 set up Git "exec-path", either via command-line一次性使用,或更好via environment variable :
export GIT_EXEC_PATH=/PATH/TO/git/libexec/git-core
关于macos - Git: 'rebase' 不是 git 命令。见 'git --help',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10125113/