Code Churn using Git - Find the files changed between two commits

When we want to know all the changes that happened between two commits, or from date A to Date B. We can get the details by querying the git repository through Terminal.

Here is the command for finding all the files changed between two commits.
git diff --stat <Commit ID 1> <Commit ID 2>
Commit ID 1 is start check in. Commit ID 2 is end check in.
The results will show all the files changed between these two commits.

Reject local commits and reset the local brnch to the remote/origin/master branch state

git fetch origin
git reset --hard origin/master

Reject local commits and reset the local brnch to the remote/feature branch state

git fetch origin
git reset --hard origin/feature/STORY-###-BranchName

Creating stash from one Branch and applying to another branch

Make change on Branch 1, Stash it from Branch 1.
Now check out Branch 2. Go to terminal and Run

git stash pop

Code Churn Steps

##Find the commit ids for periods
git log --since="2013-11-12" --until="2013-11-12"

##Find the change log stats
git log --name-only  --full-index 514b422-startid..d79e9e2-endid > .\stat.txt

##Find the change log stats using full commit IDs
git log --name-only  --full-index d2437f24858ac871a5e5f690d3f6282d90df4486..f89a41cf80e1ce419d0412e74c73e13abef3c458 > .\stat.txt


Comments

Popular posts from this blog