Git-Runoob:Git 查看提交历史
| ylbtech-Git-Runoob:Git 查看提交历史 |
| 1.返回顶部 |
Git 查看提交历史
在使用 Git 提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,我们可以使用 git log 命令查看。
针对我们前一章节的操作,使用 git log 命令列出历史提交记录如下:
$ git log
commit d5e9fc2c811e0ca2b2d28506ef7dc14171a207d9 (HEAD -> master)
Merge: c68142b 7774248
Author: runoob <test@runoob.com>
Date: Fri May 3 15:55:58 2019 +0800 Merge branch 'change_site' commit c68142b562c260c3071754623b08e2657b4c6d5b
Author: runoob <test@runoob.com>
Date: Fri May 3 15:52:12 2019 +0800 修改代码 commit 777424832e714cf65d3be79b50a4717aea51ab69 (change_site)
Author: runoob <test@runoob.com>
Date: Fri May 3 15:49:26 2019 +0800 changed the runoob.php commit c1501a244676ff55e7cccac1ecac0e18cbf6cb00
Author: runoob <test@runoob.com>
Date: Fri May 3 15:35:32 2019 +0800
我们可以用 --oneline 选项来查看历史记录的简洁的版本。
$ git log --oneline
$ git log --oneline
d5e9fc2 (HEAD -> master) Merge branch 'change_site'
c68142b 修改代码
7774248 (change_site) changed the runoob.php
c1501a2 removed test.txt、add runoob.php
3e92c19 add test.txt
3b58100 第一次版本提交
这告诉我们的是,此项目的开发历史。
我们还可以用 --graph 选项,查看历史中什么时候出现了分支、合并。以下为相同的命令,开启了拓扑图选项:
* d5e9fc2 (HEAD -> master) Merge branch 'change_site'
|\
| * 7774248 (change_site) changed the runoob.php
* | c68142b 修改代码
|/
* c1501a2 removed test.txt、add runoob.php
* 3e92c19 add test.txt
* 3b58100 第一次版本提交
现在我们可以更清楚明了地看到何时工作分叉、又何时归并。
你也可以用 --reverse 参数来逆向显示所有日志。
$ git log --reverse --oneline
3b58100 第一次版本提交
3e92c19 add test.txt
c1501a2 removed test.txt、add runoob.php
7774248 (change_site) changed the runoob.php
c68142b 修改代码
d5e9fc2 (HEAD -> master) Merge branch 'change_site'
如果只想查找指定用户的提交日志可以使用命令:git log --author , 例如,比方说我们要找 Git 源码中 Linus 提交的部分:
$ git log --author=Linus --oneline -5
81b50f3 Move 'builtin-*' into a 'builtin/' subdirectory
3bb7256 make "index-pack" a built-in
377d027 make "git pack-redundant" a built-in
b532581 make "git unpack-file" a built-in
112dd51 make "mktag" a built-in
如果你要指定日期,可以执行几个选项:--since 和 --before,但是你也可以用 --until 和 --after。
例如,如果我要看 Git 项目中三周前且在四月十八日之后的所有提交,我可以执行这个(我还用了 --no-merges 选项以隐藏合并提交):
$ git log --oneline --before={3.weeks.ago} --after={2010-04-18} --no-merges
5469e2d Git 1.7.1-rc2
d43427d Documentation/remote-helpers: Fix typos and improve language
272a36b Fixup: Second argument may be any arbitrary string
b6c8d2d Documentation/remote-helpers: Add invocation section
5ce4f4e Documentation/urls: Rewrite to accomodate transport::address
00b84e9 Documentation/remote-helpers: Rewrite description
03aa87e Documentation: Describe other situations where -z affects git diff
77bc694 rebase-interactive: silence warning when no commits rewritten
636db2c t3301: add tests to use --format="%N"
更多 git log 命令可查看:http://git-scm.com/docs/git-log
| 2.返回顶部 |
| 3.返回顶部 |
| 4.返回顶部 |
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
Git-Runoob:Git 查看提交历史的更多相关文章
- [Git]03 如何查看提交历史
在提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,可以使用 gitlog 命令查看. 常用命令 1.查看提交历史 $ git log 2.查看某个文件或者某个目录的递交历史 $ gi ...
- git学习——查看提交历史
git log可以查看提交历史: 用-p选项展开显示每次提交的内容差异,用-2则仅显示最近两次的更新:git log -p -2 在-p选项后面使用--word-diff选项进行单词层面的对比.这其中 ...
- git 使用详解(5)-- get log 查看提交历史【转】
转自:http://blog.csdn.net/wh_19910525/article/details/7468549 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 限制 ...
- 4.Git基础-查看提交历史
1.查看提交历史 -- git log 使用 git log 可以查看到所有的提交(commit)历史. 1. $ git log 列出所有commit,最新的commit在最上面.会显示每个提交 ...
- git 查看提交历史
查看提交历史 git log 查看每次提交的具体改动内容 git log -p 查看某个文件历次提交的具体改动内容 git log -p <file name> # git log -p ...
- Git 查看提交历史(分布式版本控制系统)
1.查看提交历史 在提交了若干更新,又或者克隆了某个项目之后,你也许想回顾下提交历史.完成这个任务最简单而又有效的工具是 git log 命令. $ git log commit ca82a6dff8 ...
- Git 基础 - 查看提交历史
查看提交历史 在提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,可以使用 git log 命令查看. 接下来的例子会用我专门用于演示的 simplegit 项目,运行下面的命令获取该项目源 ...
- git log 查看提交历史
文章出处http://blog.csdn.net/wh_19910525/article/details/7468549 git log 查看 提交历史 在提交了若干更新之后,又或者克隆了某个项目 ...
- git 使用详解(5)—— get log 查看提交历史
git log 查看 提交历史 在提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,可以使用 git log 命令查看. 接下来的例子会用我专门用于演示的 simplegit 项目,运行下面 ...
随机推荐
- 抄来的,占个位儿【百度架构师是怎样搭建MySQL分布式集群】
1.准备集群搭建环境 使用6台虚拟机来搭建MySQL分布式集群,相应的实验环境与对应的MySQL节点之间的对应关系如下图所示: 管理节点(MGM):这类节点的作用是管理MySQLCluster ...
- python 教程之Django(二)
官网: https://www.djangoproject.com/download/ 1.简单方法: A.pip 命令安装方法 pip install Django 打开dos命令窗口 输入命令回车 ...
- Summer training round2 #7 (Training #23)
A:约瑟夫环 套公式 B:线性筛素数 C:投骰子 概率DP F:有权无向图的生成树(边最大值和最小值只差最小) 直接kruskal G:状压BFS或者双向BFS H:模拟题 I:几何题 J:高斯消元
- Daily Affirmations 每天对自己大声说:我很棒
I was 18 the first time a therapist2) tried to get me to embrace the idea of daily affirmations. I w ...
- BZOJ1233 [Usaco2009Open]干草堆tower[贪心+单调队列优化]
地址 注意思路!多看几遍! 很巧妙的一道题.不再是决策点以dp值中一部分含j项为维护对象,而是通过维护条件来获取决策. 首先有个贪心策略,让底层的宽度尽可能小,才能让高度尽可能高.所以应该倒着dp,表 ...
- MyEclipse使用教程:导航代码(一)
[MyEclipse CI 2019.4.0安装包下载] 无论是在文件之间导航还是在文件中导航,都可以使用大量导航工具来加快工作流程.目前这些导航工具可在MyEclipse,CodeMix中使用. 快 ...
- uniapp引用iconfont图标
不得不说uniapp引入iconfont确实比较坑.下面方法可行: 引入方法: 1.在confont官网找好图标,然后点击复制代码, 2.点击红圈的复制代码后在网页打开,出现如下: 3.然后再unia ...
- JS实现表单全选以及取消全选实例
实现效果: 全选按钮:点击全选按钮所有的小按钮都会被选中:点掉全选按钮,所有按钮取消选中: 小按钮:只有全部被选中,全选按钮才会被选中 思路分析: 1.全选和取消全选做法:让下面所有复选框的 chec ...
- CF 25 E 三个字符串 KMP模板
Test Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submit Status ...
- luoguP3353 在你窗外闪耀的星星
P3353 在你窗外闪耀的星星 题目描述 飞逝的的时光不会模糊我对你的记忆.难以相信从我第一次见到你以来已经过去了3年.我仍然还生动地记得,3年前,在美丽的集美中学,从我看到你微笑着走出教室,你将头向 ...
