zoukankan      html  css  js  c++  java
  • Git 查看提交历史

    在使用 Git 提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,我们可以使用 git log 命令查看。

    我们可以用 --oneline 选项来查看历史记录的简洁的版本。

    还可以用 --graph 选项,查看历史中什么时候出现了分支、合并。以下为相同的命令,开启了拓扑图

    如果只想查找指定用户的提交日志可以使用命令:git log --author , 例如,比方说我们要找 Git 源码中 Linus 提交的部分

    如果你要指定日期,可以执行几个选项:--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"
  • 相关阅读:
    [字符串] 洛谷 P2264 情书
    [IDA*] 洛谷 P2324 骑士精神
    [Tarjan] 洛谷 P2746 校园网
    [dp][瞎搞] 洛谷 P2501 数字序列
    [虚树][lca][dfs] 洛谷 P3233 世界树
    [斜率优化][dp] 洛谷 P3648 序列分割
    [带修莫队] Bzoj 2120 数颜色
    [数学][组合数] Jzoj P4257 着色
    [贪心][前缀和] Jzoj P4256 平均数
    [dfs] 洛谷 P2535 收集资源
  • 原文地址:https://www.cnblogs.com/loaderman/p/10131774.html
Copyright © 2011-2022 走看看