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

Viewed 86800

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?

8 Answers

There Are Following Another Ways For Diffing between two entire directories/projects.

  1. In Git There is Syntax:

Syntax: git-diff [] [--] […​] This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell Git to further add to the index but you still haven’t.

Here is the. URL: https://git-scm.com/docs/git-diff

git diff --no-index directory 1 project /path directory 2 project/path >> File name

  1. Using Linux Command diff --brief --recursive dir1path/ dir2Path/

  2. If you are using windows there is an application WinMerge.

Creating the patch from dir1 to dir2 (--binary only needed for binaries):

git diff --no-prefix --no-index --binary dir1 dir2 > dir.diff

Applying the patch to contents of working directory, which has the same contents as dir1:

cd dir1_copy
git apply ../dir.diff

git apply has default -p1 which strips the leading directories in diff commands.

Related