【译】10 个有用的 git log 技巧

image.png

原作者:Srebalaji
原文地址:Ten Useful Git Log Tricks | Hacker Noon
译者:KIWI 的碎碎念

If you are using Git for a while you should have come across git log. As everyone knows, the git log is a simple command that helps us to view the changes or project history.

(如果你在使用 Git 一段时间后,应该会遇到访问 git 日志的场景。众所周知,git log 是一个帮助我们查看项目变更或项目历史的简单命令。)

Even with that simplicity, it is a very powerful tool and it comes with numerous options that help us to view the project changes and its structure. We will see some of the most used options in this article.

(尽管它是非常简单的,但是它是一个非常强大的命令工具,可以通过它提供的数量众多的选项来帮助我们去查看项目的变更与结构。在这篇文章里,我们将看到一些它最常使用的选项)

git log —oneline

This command helps you to view the commits in a cleaner way. It condenses each commit to a line and has only minimal information like shorter commit hash, commit message.

(这条命令可以帮助你以简洁的方式查看提交记录。它把提交记录浓缩在了一行,而且只保留类似较短的提交哈希值和提交信息)

git log --oneline

image.png

Filter commits by time period

(根据时间段筛选提交信息)

These commands will filter out the commits by the given time period. For example, — after will only filter commits after the given time period and — before will only filter commits before the given time period.

(这些命令可以筛选出指定时间段的提交记录,例如,--after 会筛选出指定时间之后的提交记录,*--before * 会筛选出指定时间之前的提交记录。)


                
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值