Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Diffing between two entire directories/projects in hg or git?

I inherited a project originally stored in CVS with all the revisions. I made quite a few edits, and I'm trying to compare all the changes I made in the original directory, in regards to new files added versus the old ones.

Is there some sort of utility for hg/git where I can do a tree diff, or something of that nature? So that say, there's a mark between newly added files, deleted files, am I asking for too much?

like image 501
meder omuraliev Avatar asked Nov 24 '09 18:11

meder omuraliev


1 Answers

To simply create a diff patch in git's diff format from two arbitrary files or directories, without any fancy repository stuff or version control:

git diff --no-index some/path other/path > some_filename 

Jakub Narębski's comment on knittl's answer hinted at the answer... For simplicity's sake, that's the full command.

The > part creates a file and redirects the output to it. If you don't want a file and just want the output printed in your console so you can copy it, just remove the > some_filename part.


For convenient copying and pasting, if you've already cded to a directory containing the original directory/file named a and the modified directory b, it'll be:

git diff --no-index a b > patch 
like image 189
user56reinstatemonica8 Avatar answered Oct 11 '22 12:10

user56reinstatemonica8