Finding all the checkins in a git branch (aka finding all the files with a commit)

Identifying files which have changed between two branches in git using the cygwin command line. (Note: I assume this works for any command line git tool).

1. If the files were checked in using windows there may be issues with line endings. To make your git command line ignore line ending differences in files perform the following:

In your git config file (in my case the path is \Repos\BI.EDW\.git\config) Add the following line in the [core] section with a tab first:

For example:

bare = false
repositoryformatversion = 0
filemode = false
symlinks = false
ignorecase = true
logallrefupdates = true

2. Then checkout one of the branches you would like to compare to using the following command:

git checkout "Release-15.5"

3. Run the git diff command with the name only switch and the name of the branch you want to compare to.

git diff --name-only "master"

This will give you a list of all files which were modified between the checkout branch and the branch listed in the git diff command. (In the example above the “Release-15.5” branch and the “master” branch.

Good luck!

Leave a Reply

Your email address will not be published.