How can we get the difference between two git repositories?
The scenario: We have a repo_a and repo_b. The latter was created as a copy of repo_a. There have been pa
Meld can compare directories:
meld directory1 directory2
Just use the directories of the two git repos and you will get a nice graphical comparison:
When you click on one of the blue items, you can see what changed.
Your best bet is to have both repos on your local machine and use the linux diff command with the two directories as parameters:
diff -r repo-A repo-B
Reminder to self... fetch first, else the repository has not local hash (I guess).
step 1. Setup the upstream remote and above^
diffing a single file follows this pattern :
git diff localBranch uptreamBranch --spacepath/singlefile
git diff master upstream/nameofrepo -- src/index.js
An easy way to do that without touching your remotes config. From repo A, in master (assume you want to compare master branches):
git fetch path/to/repo_b.git master
git diff FETCH_HEAD
Once you have both branches in one repository you can do a git diff
. And getting them in one repository is as easy as
git fetch /the/other/repo/.git refs/heads/*:refs/remotes/other/*