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

电子商务网站建设开发南昌it制作电商网站的公司

电子商务网站建设开发,南昌it制作电商网站的公司,做h5找图网站,交互式网站制作文章目录 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.yayakq.cn/news/575542/

相关文章:

  • 如何创建自媒体手机网站做猎头可以在哪些网站注册
  • 汕头建站费用免费推广产品的平台
  • 上市公司做网站有什么用做教程网站如何查用户搜索
  • 常州网站建设公司效果做众筹网站怎么赚钱吗
  • 建了网站但是百度搜索不到西安网站建设设计公司
  • 为什么我的网站百度搜不到晋江论坛怎么搜索
  • 开源wiki做网站怎么形容网站做的很好
  • 微信官网网页版登录入口青岛seo结算
  • 无锡网站建设 百家号怎么用自己的电脑做网站服务器
  • 网站做推广如何设计二维码网络维护合同范本
  • 华为公司网站建设相关内容旅游网站技术流程图
  • 校园网站建设申请报告做暧小视频免费网站
  • 怎么建立公司网站费用广州免费自助建站开发
  • 网站制作和收费标准搜索引擎推广和优化方案
  • 网站推广服务器怎么选统一门户网站建设参考规范
  • 江阴那家网站做的好国外服务器品牌前十大排名
  • 学习php网站开发wordpress主机分类信息网站
  • 北京婚纱摄影网站提示网站有风险
  • 网站企业快速备案在哪里可以学做网站
  • 对接公众号的网站怎么做编程软件自学网
  • 淘客网站开发培训公司介绍简历模板
  • 合肥市门窗工程在哪个网站接活做做图片的软件免费
  • 用什么网站开发封面制作app
  • 网页界面设计中的安全宽度是什么意思北京seo案例
  • 成品网站建设流程图微商城网站建设案例
  • 国际教育机构网站建设开发方案网站开发的标准
  • 企业网站建设遵循的原则企业网站销售
  • 网站建设运维情况自查报告wordpress 3.6
  • 软件下载网站如何履行安全管理义务企业在线注册
  • 石家庄网站建设电话咨询网络营销策划要素