在$ VCS中,我大量使用$VCS diff -c $N
来查看修订版$N
中引入的更改(即diff -r $N..$N+1
)。
我怎样才能用git做同样的事情?
答案 0 :(得分:8)
# git show -p SHA1_COMMIT
答案 1 :(得分:6)
git diff SHA1_COMMIT^ SHA1_COMMIT
SHA1_COMMIT
是您要检查的提交的SHA1
“ git diff
”会比较:
正如source code of the builtin-diff.c中所提到的,解析的语法是:
static const char builtin_diff_usage[] =
"git diff <options> <rev>{0,2} -- <path>*"