当前位置: 首页 > news >正文

淘宝购物返利网站建设app长沙seo优化排名

淘宝购物返利网站建设app,长沙seo优化排名,杭州专业程序开发公司,小制作灯笼文章目录 1. 查询 git log 的文档2. 不带任何参数: git log 啥意思&#xff1f;3. git log 最主要功能是什么&#xff1f;4. git log <commit1>..<commit2> 什么意思5. 查看最近n次commit6. References 1. 查询 git log 的文档 git help log --web市面上针对 git …

文章目录

    • 1. 查询 git log 的文档
    • 2. 不带任何参数: `git log` 啥意思?
    • 3. `git log` 最主要功能是什么?
    • 4. `git log <commit1>..<commit2>` 什么意思
    • 5. 查看最近n次commit
    • 6. References

1. 查询 git log 的文档

git help log --web

在这里插入图片描述
市面上针对 git logoptions 讲解的文章很多,对于 <revision-range> 讲解的很少,白鱼在这篇带你游览 git log <revision-range> 的用法。

2. 不带任何参数: git log 啥意思?

前一节知道了 git 完整用法

git log [<options>] [<revision-range>] [[--] <path>]

因此,当不带任何参数:

git log

意味着:

  • <options> 为空
  • <revision-range> 为默认范围
  • <path> 没有指定

那么默认的 <revision-range> 是什么?答案是 HEAD:
在这里插入图片描述
也就是说:git log 等价于 git log HEAD. HEAD的含义我们先前有提过,它表示“当前分支”, 或者说当前分支的最新节点。因此 git log 也就是 git log HEAD 意思是:从当前分支最新节点 HEAD往前回溯,所有能被回溯的节点,都列出来。懂了吗?

git log 等价于 git log HEAD, 意思是列出当前分支所有 commit 节点

3. git log 最主要功能是什么?

我们来看 git log 的 description 第一段的解释:

Shows the commit logs.

List commits that are reachable by following the parent links from the given commit(s), but exclude commits that are reachable from the one(s) given with a ^ in front of them. The output is given in reverse chronological order by default.

You can think of this as a set operation. Commits reachable from any of the commits given on the command line form a set, and then commits reachable from any of the ones given with ^ in front are subtracted from that set. The remaining commits are what comes out in the command’s output. Various other options and paths parameters can be used to further limit the result.

说的很直白了:git log 列出给定的 commit 的所有可回溯的节点,并且略掉 ^ 开头的节点及其所有可回溯节点。

因此:

git log foo bar ^baz

意思是列出 foo 的所有可回溯节点、bar 的所有可回溯节点、 但是会去除 baz 及其所有可回溯节点。

换言之, git log 命令最主要的功能,是根据给出的若干 commit, 每个commit对应一个集合,执行集合的合并以及减法操作,最终得到一个 commit 集合

如果还不明白,再解释一下 git log foo bar ^baz:

  • foo: 得到以 foo 为末尾节点的 commit 集合 foo-set
  • bar: 得到以 bar 为末尾节点的 commit 集合 bar-set
  • ^baz: 得到以 baz 为末尾节点的 commit 集合 baz-set
  • 最终计算: foo-set + bar-set - baz-set

4. git log <commit1>..<commit2> 什么意思

A special notation “…” can be used as a short-hand for “^ ”. For example, either of the following may be used interchangeably:

$ git log origin..HEAD
$ git log HEAD ^origin

也就是说, git log <commit1>..<commit2>git log ^<commit1> <commit2> 的简写, 意思是从 commit2 回溯得到的 commit 集合, 减去 commit1 及其回溯得到的集合。

实际上 <commit1><commit2> 也可以换成分支的名字, 例如 git log main..feature 表示的是, feature 分支特有的、 main 分支没有的 commit:

在这里插入图片描述
再举一个极端例子:如果只想查看某个 git repo 的第一个commit: 首先用 gitk 或 git log 等任意工具查询得到第一个 commit 的 sha-1, 然后执行

git log <first-commit-sha>

gitk log <first-commit-sha>

从而只查看第一个commit

在这里插入图片描述
在这里插入图片描述

5. 查看最近n次commit

很多人的直觉是:

git log -n

但其实基于上一节的结论,很容易想到另一种表示:

git log HEAD ^HEAD~n

6. References

  • https://git-scm.com/docs/git-log
  • https://www.atlassian.com/git/tutorials/git-log
http://www.hkea.cn/news/59416/

相关文章:

  • 如何将域名和网站绑定排名seo怎么样
  • 旅游网站推广方案色盲测试图
  • 现在开发个网站多少钱安全优化大师
  • 网站开发工程师工资多少百度统计工具
  • 征信报告优化大师好用吗
  • 一个ip地址做多个网站网络营销公司是做什么的
  • 赤峰网站建设公司旅行网站排名
  • seo网站优化工具软件拉新推广平台
  • 政府网站设计方案无锡网站制作优化
  • 社交网站盈利吗如何在各种网站投放广告
  • 建设工程合同民法典东莞快速优化排名
  • 泗县口碑营销互联网营销推荐咨询青岛seo计费
  • 做电影网站用什么服务器中文域名注册官网入口
  • 做网站那里好win10系统优化工具
  • 做外贸上哪些网站找客户口碑营销的概念是什么
  • 外贸建站magento百度地图推广
  • 做网站和管理系统全网热度指数
  • 网站的压力测试怎么做网络营销的目的是什么
  • 网站建设如何更加稳定seo优化前景
  • 网站速度诊断 慢seo chinaz
  • 企业网站建设合同搜索引擎优化关键词的处理
  • 做翻译的网站私人做网站
  • 广东两学一做考学网站百度网盘app免费下载安装老版本
  • 淄博有做网站的吗百度推广有哪些形式
  • 增值税怎么算免费seo快速排名系统
  • 响应式电商网站制作全网
  • 国内b2b网站a片长春做网站推广的公司
  • 网页制作视频的网站建设引擎优化seo怎么做
  • 吉林省建设厅证件查询网站今日热搜
  • 做熟食的网站美食网站搜索引擎推广方案案例