macos - Git: 'rebase' 不是 git 命令。见 'git --help'

标签 macos git github github-for-mac

我设置了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/

相关文章:

javascript - 在 Mac 中学习 javascript 的简单环境设置是什么

python - 语音识别,断言错误 "Source must be an audio source"

git - 使用 Cloud9 和 Openshift 时警告 : setlocale: LC_ALL: cannot change locale (C. UTF-8)

python - 如果我正在制作 pip 模块,需要上传或添加哪些文件到 git 存储库

git - 为什么当我切换分支时 Git 不删除一些文件?

github - Gatsby 在 Netlify 上部署失败,字段 'browser' 不包含有效的别名配置

github 在使用 pull 命令时锁定 mac 终端

ios - OSX/iOS : Reading a . WAV 到 float 缓冲区

node.js - 无法从 Homebrew 软件安装watchman

没有旧提交的 Github pull 请求