1.有多次提交记录。 2.只显示 8dd428 这个 commit 的 log git show 8dd428 3.加上 --name-only 参数,只显示文件名,不显示对比差异信息 git show --name-only 8dd428 4.加上 --data 设置日期显示方式。 --date 更详细用法 --> git --date时间显示设置格式命令 git show a19f17
我们常见的是在git log后面添加上-p 或--patch 它会显示每次commit提交时所引入的差异(也就是本次提交和仓库最新记录之间的差异)。整个结果会按照补丁的格式输出。 示例: 然后会发现这个log 的输出内容会很多很杂。 因为它会显示log的基本信息以外,还会附带每次提交的变化。当我们进行代码审查,或快速浏览某个提交...
二、显示 40位 commit-ID 提交日期 提交说明 gitlog--pretty=format:'%C(auto)%H%C(blue) %<|(19)%as%C(auto)%d %s' 或 gitlog--format='%C(auto)%H%C(blue) %as%C(auto)%d %s' 三、限制某列的宽度 及 为了把截断产生的"."删除 正常显示 gitlog--pretty=format:'%C(auto)%h %C(auto)...
四、Git Commit 的高级应用场景 4.1 精准回滚 # 找到问题Commitgit log --grep="登录异常"# 回退到指定版本(保留更改)git revert a1b2c3d# 彻底删除某次提交(慎用!)git rebase -i a1b2c3d^ 4.2 二分法排查Bug git bisect startgit bisect bad HEADgit bisect good v1.0# Git会自动定位问题引入...
没有Git、Commit菜单? 到顶部菜单点File-》Settings,选择Plugins,启用【Git插件】 : 二、忽略指定文件(.gitignore) 在项目里,有些文件或文件夹是不需要记录版本的,像.idea,target等等,我们可以在.gitignore文件中指定忽略。 所以,在项目文件夹里,手动创建.gitignore文件: ...
git log -p commitID详细查看commitID的具体内容,或者git log -p fileName 详细查询fileName的修改记录 git log -L :funcName:fileName 查看fileName文件中funcName函数的修改历史 git log --pretty=oneline 简易的查看commit 记录(直接用git log --oneline更方便一些) git reflog 用在回退时的场景, 当发生...
某金融系统因一个大型Commit引入数据错误,最终需要回滚3天工作量;而拆分小Commit后,类似问题可在10分钟内修复。 2.2 提升可读性:原子化变更 优秀Commit的特征: 单一责任原则:一个Commit只做一件事(如”修复登录页CSS错位”) 清晰的消息格式: 类型(模块): 简要说明 详细描述(可选) Refs: #ISSUE_ID 示例: fix...
四、Git Commit 的高级应用场景 4.1 精准回滚 # 找到问题Commitgit log --grep="登录异常"# 回退到指定版本(保留更改)git revert a1b2c3d# 彻底删除某次提交(慎用!)git rebase -i a1b2c3d^ 4.2 二分法排查Bug git bisect startgit bisect bad HEADgit bisect good v1.0# Git会自动定位问题引入点 ...
focal (1) git-log.1.gz Provided by: git-man_2.25.1-1ubuntu3.13_all NAME git-log - Show commit logs SYNOPSIS git log [<options>] [<revision range>] [[--] <path>...] DESCRIPTION Shows the commit logs. The command takes options applicable to the git rev-list command to ...
Show the notes (see git-notes[1]) that annotate the commit, when showing the commit log message. This is the default for git log, git show and git whatchanged commands when there is no --pretty, --format, or --oneline option given on the command line. By default, the notes shown ...