git diff one of committed file All In One
git-diff - Show changes between commits, commit and working tree, etc
git diff [<options>] [<commit>] [--] [<path>…]
git diff [<options>] --cached [--merge-base] [<commit>] [--] [<path>…]
git diff [<options>] [--merge-base] <commit> [<commit>…] <commit> [--] [<path>…]
git diff [<options>] <commit>…<commit> [--] [<path>…]
git diff [<options>] <blob> <blob>
git diff [<options>] --no-index [--] <path> <path>
https://git-scm.com/docs/git-diff
$ git diff
# one commits back & now
$ git diff HEAD^ HEAD package.json
# two commits back & now
$ git diff HEAD^^ HEAD package.json
# git diff <revision_1>:<file_1> <revision_2>:<file_2>
demo
$ gst
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: react-version/yarn.lock
deleted: vue-versioon/yarn.lock
$ git diff HEAD^ HEAD -- ./vue-versioon/yarn.lock
refs
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-diff.html
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 ️,侵权必究⚠️!