Skip to content

Instantly share code, notes, and snippets.

@samarpanda
Last active October 13, 2015 03:28
Show Gist options
  • Save samarpanda/4132317 to your computer and use it in GitHub Desktop.
Save samarpanda/4132317 to your computer and use it in GitHub Desktop.
Git help commands to retrieve branch file changes

Git commands to retrieve branch add/Edit file changes

Modified Files

 git diff HASH_KEY --name-only --diff-filter=[M]

Added files

 git diff HASH_KEY --name-only --diff-filter=[A]

Files diff with number of deletes and Insertions

 git diff HASH_KEY --stat

For checking all whitespaces

 git diff HASH_KEY --check

To get file chages of current branch compared to a branch i.e dev here

// Current branch is sp
git checkout sp
git diff --name-status origin/dev

** HASH_KEY - Is one of the commit history you want to compare with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment