From Viewing Unpushed Git Commits I know how to make diff between a repo on my own and my local commits:
git diff origin/master..HEAD
But, How can I do the same instead of origin using a path/to/github/repo.git
?
git diff https://github.com/malarres/universal.git/GPII-795..HEAD
is returning:
fatal: Invalid object name 'https'.
How can I do the same instead of
origin
using apath/to/github/repo.git
?
git diff https://github.com/malarres/universal.git/GPII-795..HEAD
That's not the way git diff
works. If you want to diff between your local repo and another repo, you need to do the following:
Add the latter as a remote of the former. Note that nothing prevents you from defining multiple remotes, in addition to origin
, within one repository. (You may want to choose a less generic remote name than "other", though.)
git remote add other https://github.com/malarres/universal.git/GPII-795
Fetch everything from that remote:
git fetch other
Run the appropriate git diff
command, for instance,
git diff other/master..HEAD
If you later want to remove that remote from your repository, you can run
git remote rm other
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With