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

前端 未结 8 607
谎友^
谎友^ 2020-12-02 12:05

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,

8条回答
  •  醉梦人生
    2020-12-02 12:51

    Is there some sort of utility for hg/git where I can do a tree diff... [s]o that say, there's a mark between newly added files, deleted files... [emphasis added]

    Yes. We can git diff the current directory against another directory and...

    ...mark the added, deleted, and modified files:

    git diff --name-status --no-index ./ path/to/other/dir
    

    ...show only added files:

    git diff --diff-filter=A --name-status --no-index ./ path/to/other/dir
    

    ... show only deleted files:

    git diff --diff-filter=D --name-status --no-index ./ path/to/other/dir
    

    ...show only modified files:

    git diff --diff-filter=M --name-status --no-index ./ path/to/other/dir
    

    See also: https://git-scm.com/docs/git-diff

提交回复
热议问题