git diff one of committed file All In One
git diff one of committed file All In One
git-diff - Show changes between commits, commit and working tree, etc
$ git --help
$ git help diff
# quit === Command + C
Unknown locale, assuming C
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>
demos
$ 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
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/15428843.html
未经授权禁止转载,违者必究!