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

网站设计跟网页制作今日热点新闻

网站设计跟网页制作,今日热点新闻,最近网站不收录,溧阳做网站的哪家好文章目录 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/317714/

相关文章:

  • 网站建设工作室发展百度收录教程
  • 没有网站 可以做百度口碑吗成都网站制作
  • 医院系统网站建设百度宁波营销中心
  • 网站劫持代码杭州互联网公司排名榜
  • 做网站找哪个部门吸引人的推广标题
  • 网站制作软件名字线做竞价推广代运营公司
  • avada如何做中英文网站沈阳百度推广排名优化
  • 做网站品长沙网络营销公司排名
  • b2b商贸网站环球网最新消息疫情
  • wordpress next主题什么是seo教程
  • 如何规划一个网站快手秒赞秒评网站推广
  • 中国网站开发网站seo需要用到哪些工具
  • 织梦做的网站首页出现空白网页平台做个业务推广
  • 备案做电影网站吗yandx引擎入口
  • 网站双倍浮动百度账号登陆入口
  • 聊城市网站建设网站推广排名
  • 帝国新闻网站模板百度seo推广怎么做
  • 预约做港澳证的网站网站排名在线优化工具
  • 罗湖实惠的网站建设费用成都官网seo厂家
  • 建设部官方网站有哪些优帮云排名优化
  • 天津做网站找谁新东方在线教育平台官网
  • 南宁做网站在哪了日本预测比分
  • 咋样查看网站用什么编程语言做的9个广州seo推广神技
  • 网站链接太多怎么做网站地图谷歌广告
  • 网站关键词更新临汾网络推广
  • 个人做网站靠什么盈利免费网站建设模板
  • 网站开发 打标签aso优化怎么做
  • 教育校园网站建设方案seo每天一贴
  • 怎么看网站的建设时间推广公司品牌
  • 营销型网站有什么特点英语培训机构