GIT: Find commits for a specific file

git log --stat component/src/main/resources/META-INF/spring/context-osgi.xml

 Gets you a list of all the commits including that file.

git diff $commit_hash_old $commit_hash_current component/src/main/resources/META-INF/spring/context-osgi.xml

Shows you the diffs between the old file and the one you have now.

Cross ref: git blame might be more useful. Tells you which lines of a file were changed by whom:

git blame component/src/main/resources/META-INF/spring/context-osgi.xml

6d4e6fd3 (Dick Dastardly 2012-07-26 15:28:33 +0100 24) VirtualTopic.com.some.co.error.DLC
6d4e6fd3 (Dick Dastardly 2012-07-26 15:28:33 +0100 25) /data/error/
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 26)
6d713a0a (Muttley 2012-10-18 13:44:33 +0100 27)
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 28) mappingPersistenceUnit
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 29) HSQL
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 30) org.apache.openjpa.jdbc.sql.HSQLDictionary
c3cedfe7 (Dick Dastardly 2012-06-13 16:10:19 +0100 31) org.hsqldb.jdbc.JDBCDriver
47e39616 (Dick Dastardly 2012-06-21 14:12:40 +0100 32) jdbc:hsqldb:data/resource/lookup.db
3233b294 (Peter Perfect 2012-11-07 13:16:34 +0000 35) 1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s