0

Is there any software that can collect all the changed files between two commits to a folder? I need this functionality to create an update patch.

My current solution is creating two release tags and looking at the difference between them. Then, I manually collect the changed files. This is really inefficient and error prone because there are 100s of changed files!

Is there a software that can collect all changed files between two commits?

Update: I am looking for a software that can provide me this functionality in a GUI interface. Is it possible to do this without touching the command line?

Ray Li
  • 7,601
  • 6
  • 25
  • 41
  • https://stackoverflow.com/a/39764481/7034621 – orhtej2 Oct 10 '17 at 21:56
  • 1
    Here's the script from a project I used to work on: https://github.com/themanaworld/tmw-tools/blob/master/client/make-updates – o11c Oct 10 '17 at 22:03
  • You don't need to create tags. Any command you can use a tag, you can use a commit hash. And try this to get a list of files: `git diff --name-only -- `. Or this to get a patch you can apply `git diff -- > /tmp/changes.patch` – Mort Oct 10 '17 at 22:05
  • Possible duplicate of [How to export all changed files between two Git commits in SourceTree?](https://stackoverflow.com/questions/30482130/how-to-export-all-changed-files-between-two-git-commits-in-sourcetree) – phd Oct 10 '17 at 22:13

1 Answers1

0

You don't need to create any tags, you can just use commit hashes.

Using --name-only --format="" you can get all the file names a commit changed. Then, some simple shell commands can give you a unique list of files:

$ git log <start>..<end> --name-only --format="" | sort | uniq

E.g.:

$ git log ad5b4ee5d43..90c1172a913 --name-only --format="" | sort | uniq
Mureinik
  • 297,002
  • 52
  • 306
  • 350