【发布时间】:2014-08-28 23:49:07
【问题描述】:
我在比较本地 master(与 origin/master 相同的提交)与生产/master 时遇到问题。
$ git remote -v
origin git@github.com:mydomain/mydomain.git (fetch)
origin git@github.com:mydomain/mydomain.git (push)
production git@heroku.com:mydomain-production.git (fetch)
production git@heroku.com:mydomain-production.git (push)
staging git@heroku.com:mydomain-staging.git (fetch)
staging git@heroku.com:mydomain-staging.git (push)
我似乎能够获得与 staging/master 的差异,但我得到与 production/master 的错误:
$ git diff staging/master
[i'm shown diff]
$ git diff production/master
fatal: ambiguous argument 'production/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
有人知道我在搞砸什么吗?
我真正想做的是查看本地 master 上的提交,这些提交不在其他远程上的提交,例如 git diff production/master...master 但这会产生相同的错误:
$ git diff production/master...master
fatal: ambiguous argument 'production/master...master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
【问题讨论】:
-
我过去使用的是
git fetch production master && git diff master production/master。这对你有用吗? -
那行得通。我想我以前从来没有在那个遥控器上
git fetched?!?不确定。 -
太棒了!那么,我将其添加为答案。