Generate diff file of a specific commit in Git

See the changes of a specific commit:

git diff <commit-sha> -p

Or,

git show --decorate <commit-sha>    # See 'Author', 'Date' and 'diff'

See the diff of two commits:

git diff <commit1> <commit2>

See the file changes for a specific commit:

git show <commit>:<file>

See all the changes for a time duration (say, 1 day):

git whatchanged --since="1 day ago" -p
git whatchanged --since="1 day ago" -p <file>   # See changes for a specific file only

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)