Git: compare local branch versus remote staging and production
I am having trouble mapping the local master (which is on the same commit as origin / master) with production / 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)
I seem to be able to get diff with staging/master
, but I am getting errors with 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>...]'
Does anyone see me screwing up?
What I really want to do is see commits on the local master that are not related to other remote devices with something like git diff production/master...master
, but that gives the same error:
$ 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>...]'
source to share
What I have used in the past
git fetch production master && git diff master production/master
Perhaps you have never chosen this remote before.
In terms of looking at commits that are not on production/master
, but are on local master
, it git log
might be better suited:
git log --oneline production/master..master
source to share