Git 使用学习笔记
  • 本书介绍
  • Git基础
    • Git追踪文件的生命周期
    • 文件状态
    • 修改类型
    • 理解Git三个树
    • 理解git checkout与git reset区别
  • Git基本命令
    • 文件操作
      • git mv
      • git rm
      • git add
    • 查询
      • git status
      • git diff & git difftool
      • git log
    • 提交、撤销与拉取
      • git commit
      • git checkout
      • git reset
    • 远程库操作
      • git clone
      • git remote
      • git fetch
      • git push
    • 标签
      • git tag & git show
    • 分支操作与管理
      • git branch
      • git checkout
      • git merge
      • git rebase
    • 偏好设置
      • git config
  • Git高级命令
    • 储藏与清理
      • git stash
    • 提取
      • git cherry-pick
    • 常用场景实战
      • 修改commit提交
      • 修改远程仓库提交
  • .gitignore
    • 使用.gitignore文件
    • glob模式
  • GitLab操作
    • 什么是GitLab
    • 基于 Merge Request 的开发流程
    • 如何撤销 Merge Request?
Powered by GitBook
On this page
  • 查看git提交历史
  • 其他格式输出

Was this helpful?

  1. Git基本命令
  2. 查询

git log

查看git提交历史

查看git提交历史

git log
  • 无参数

详细的状态输出(包括commit,Author,Date,comment)

$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: Scott Chacon <schacon@gee-mail.com>
Date:   Mon Mar 17 21:52:11 2008 -0700

    changed the version number

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: Scott Chacon <schacon@gee-mail.com>
Date:   Sat Mar 15 16:40:33 2008 -0700

    removed unnecessary test code

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: Scott Chacon <schacon@gee-mail.com>
Date:   Sat Mar 15 10:31:28 2008 -0700

    first commit

其他格式输出

git log --pretty=oneline
  • 选项

    • --pretty=[oneline|short|full|fuller] (显示格式)

提供其他格式输出选项,oneline 一行紧凑

$ git log --pretty=oneline
ca82a6dff817ec66f44342007202690a93763949 changed the version number
085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7 removed unnecessary test code
a11bef06a3f659402fe7563abf99ad00de2209e6 first commit
Previousgit diff & git difftoolNext提交、撤销与拉取

Last updated 6 years ago

Was this helpful?