Git:比较本地分支与远程转移和生产

Git:比较本地分支与远程转移和生产,git,github,diff,master,Git,Github,Diff,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:mydomai

我在比较本地主机(与源站/主机处于同一提交状态)和生产/主机时遇到问题

$ 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>...]'

我过去用的是

git fetch production master && git diff master production/master
你以前可能从未从那个遥控器取过


就查看不在
production/master
上但在本地
master
上的提交而言,
git log
可能更合适:

git log --oneline production/master..master

我过去使用的是
git fetch production master&&git diff master production/master
。对你有用吗?有用。我想我以前从未从那个遥控器上取过艾德?!?不太清楚,太棒了!那么,我将把它作为一个答案加上。
git log --oneline production/master..master