Last Updated: February 25, 2016
· rock3r

Determine all the files that have changed in Git

In Git, you can use the log command to display historical information about the current branch commits.

This is useful, especially if you want to determine which files have been changed since a specified point in time.

A typical use case for this is, for Android development, to determine all the new string resources that have been added, in order to be able to extract them and have them translated.

For example, in the root of an app folder tree (or of a repo, in case it contains more than one app), you can type the following:

git log -p --author=YourName -- */res/values/strings.xml

This is assuming that you always and only add new string resources in the generic values resource folder, and that your strings are all in the strings.xml file in the various values folders.

The -p switch makes git print the diffs for each commit. If you don't want them, for some reason, you can omit it. You won't be getting the modified files and strings thou, only the basic commit data (SHA hash, author, title line, message, etc, depending on the commit format you choose).