1. `git log`:显示完整的commit历史记录,包括每个commit的哈希值、作者、日期和提交消息。 2. `git show [commit]`:显示特定commit的详细信息,包括修改的文件、代码变动以及提交消息。 3. `git diff [commit1] [commit2]`:比较两个commit之间的差异,可以通过它来查看commit之间具体修改了
#安装 $ npm install validate-commit-msg husky -D #添加package.json文件配置 "husky": { "hooks": { "commit-msg": "validate-commit-msg" } } #自定义校验格式(可选) #添加一个.vcmrc文件,配置对象如下: { "types": ["feat", "fix", "docs", "style", "refactor", "perf", "test", "...
git diff-tree-r{commit}Copy This will recursively (visit all folders) list the files that have changed, likegit showwe can pass some additional parameters to tidy the output up. --no-commit-idwill remove the commit ID output --name-onlywill display only the names of files that changed, ...
这只能在没有推送之前有用. 如果你已经推了, 唯一安全能做的是git revert SHAofBadCommit, 那会创建一个新的提交(commit)用于撤消前一个提交的所有变化(changes);或者, 如果你推的这个分支是rebase-safe的 (例如:其它开发者不会从这个分支拉), 只需要使用git push -f。 删除任意提交(commit) 同样的警告:不...
使用git log --stat命令可以看出修改了那些文件以及添加或删除了多少行代码,如上图中 7 files changed, 91 insertions, 58 deletions就是修改了7个文件,增加了91行代码,删除了58行代码。 使用git log -p命令则可以让我更清楚的看到修改、增加或删除了哪些内容。
回滚commit本地却未改 这种情况是git已经回滚成功了,但是本地保留了修改文件,需要用clean命令进行清除。 记得多用git status查看状态,有利于搞清除文件情况。 关于clean命令 # 删除 untracked filesgit clean-f# 连 untracked 的目录也一起删掉git clean-fd# 连 gitignore 的untrack 文件/目录也一起删掉 (慎用!一...
Make diff output for merge commits to be shown in the default format. The default format can be changed usinglog.diffMergesconfiguration variable, whose default value isseparate. first-parent, 1 Show full diff with respect to first parent. This is the same format as--patchproduces for non-me...
first commit README | 6 +++++ Rakefile | 23 +++++++++++++ lib/simplegit.rb | 25 +++++++++++++++ 3 files changed, 54 insertions(+) 正如你所看到的,--stat选项在每次提交的下面列出所有被修改过的文件、有多少文件被修改了以及被修改过的文件的哪些行被移除或是添加了。 在每次提交的最...
Modified files - The files you've changed since your last commit but haven't staged for the next commit. Staged files - The files you've changed since your last commit and staged for the next commit. When you create a commit, only staged files and unmodified files are used for the snap...
git commit --amend --reset-author 3 files changed, 9 insertions(+) create mode 100644 README create mode 100644 main.c create mode 100644 testdir/test.c [root@wrlinux3 mygit]# ls -latr .git/objects/ total 40 drwxr-xr-x. 2 root root 4096 Apr 28 13:34 pack ...