Create a list of modified files / directories / etc. using git between two tags

I need to create a change list between two tags within a project managed with git, in particular the Android source code. This list should contain any files / directories / etc that have been edited, moved, renamed, deleted, created.

Any help would be great. And if you have a way to do this all over the Android source right away ... even better.

+6
git android diff changelog
source share
2 answers

If you need to find which files are different:

git diff --name-only <tag1> <tag2> 

If you need to find all modified files:

 git log --name-only --pretty=format: <tag1>..<tag2> | grep -v '^$' | sort | uniq 

--pretty=format: consists in interrupting the printing of information about commits and printing only part of the diff. Note that in the case of git log, the values โ€‹โ€‹are <tag1> and <tag2> .

+6
source share

As I mentioned in the comments, How to find shared files modified between git branches? is the main solution here:

 git log [--pretty=<format>] --name-only tag1..tag2 

or

 git diff --name-only tag1 tag2 

(Also mentioned in the recipe for githology )

BUT: as stated in " How do I get the list of directories deleted in my git repository? Git only tracks content files, not the directories themselves .

To include directory information, you need to start playing with git diff-tree .

any created or deleted directory will have 040000 in the second or first column and 000000 in the first or second columns, respectively. These are the "input" tree modes for the left and right entries.

Something like (according to Charles Bailey ):

 git diff-tree -t origin/master master | grep 040000 | grep -v -E '^:040000 040000' 
+1
source share

All Articles