Search code examples
gitdiffgit-diff

How to show in diff that a file was just deleted


I have a GIT repository with many very large files that I've deleted in my recent change. Using git-diff generates this giant diff file that is difficult to work with. The reason the file is giant is because it lists the contents of the files that were deleted.

Is there any way to create a diff version that will just list that a file was deleted? I've tried --irreversible-delete but it doesn't look like our GIT 1.7.3.2 supports it. Using --diff-filter won't work either. Does diff format actually have an option to list file as deleted without all the old contents?


Solution

  • You will need to upgrade to a version of Git at least 1.7.6, where the option was added.

    Note that you can still use the older version of Git as well; you just need to use the newer one to produce the diffs.