2014-08-28 103 views
3

我在比較本地主站(與原始/主站相同提交)和生產/主站時遇到了問題。Git:將本地分支與遠程分段和產品進行比較

$ git remote -v 
origin [email protected]:mydomain/mydomain.git (fetch) 
origin [email protected]:mydomain/mydomain.git (push) 
production [email protected]:mydomain-production.git (fetch) 
production [email protected]:mydomain-production.git (push) 
staging [email protected]:mydomain-staging.git (fetch) 
staging [email protected]: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 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>...]' 
+0

我已經在過去使用的是什麼混帳'取生產master && git diff master master production/master'。那對你有用嗎? – avacariu 2014-08-29 00:11:40

+0

工作。我想我從來沒有從這個遙控器上g f???!?不完全確定。 – Meltemi 2014-08-29 00:14:54

+0

太棒了!那麼我會將它添加爲答案。 – avacariu 2014-08-29 00:38:53

回答

-1

我在使用過過去是

git fetch production master && git diff master production/master 

您可能以前從未從該遙控器獲取過。


在看到使不上production/master,但對當地master的提交方面,git log可能是更好的選擇:

git log --oneline production/master..master