git实战-2、gitk使用

git实战-2、gitk使用

前言

gitk官方介绍:
https://git-scm.com/docs/gitk

概念:显示存储库或选定提交点的更改信息。这包括可视化commit图,显示与每个commit相关的信息,以及每个修订的树中的文件。

使用git客户端,试图理解git世界中checkout,commit,branch,remote,rebase等术语

在window客户端进入到git仓库,使用命令打开gitk工具窗:

gitk --all

gitk可视化页面说明

在这里插入图片描述

说明信息:

  1. 左上方窗格显示了此存储库的一系列提交,其中最新的提交位于顶部。
  2. 右边窗格显示所选提交的用户信息和提交时间
  3. 所选提交的message
  4. 名为“master”的本地分支,它指向最近的提交
  5. 远程引用分支,远程存储库的名为“origin”的“master”分支,指向最近的提交。
  6. 黄点表示上次提交点HEAD、红色表示本地还存在未add的文件、绿色表示本地改变的文件已经add,但是还没有提交、蓝色表示已经提交的记录
  7. 所选提交的详情,author:作者,commiter:提交者,Parent:上次提交的SHA ID,child:下次提交的SHA ID,branch所提交的分支,follows:跟进者,precedes:领先
  8. 提交的提交SHA ID(唯一标识符,类似于subversion修订号)
  9. 本次提交变化的文件
    10、提交文件的基本信息

git操作和gitk视图变化

新建dev分支,F5刷新gitk工具,视图刷新,我们可以进行一些git常规操作,去F5刷新对应gitk视图,进行可视化的查看git status

git branch dev

在这里插入图片描述

git checkout dev

在这里插入图片描述

git commit -am"test commit"

在这里插入图片描述

查看gitk,出现dev黄色提交点,说当前库指向了新的分支ddev。

在这里插入图片描述

切回去master库,git checkout master

git merge dev

在这里插入图片描述

git branch -d dev

在这里插入图片描述

给test_commit2 创建一个标签 2.31

在这里插入图片描述

git选项说明

摘自:https://git-scm.com/docs/gitk

–all
Show all refs (branches, tags, etc.).

–branches[=]
–tags[=]
–remotes[=]
Pretend as if all the branches (tags, remote branches, resp.) are listed on the command line as . If is given, limit refs to ones matching given shell glob. If pattern lacks ?, , or [, / at the end is implied.

–since=
Show commits more recent than a specific date.

–until=
Show commits older than a specific date.

–date-order
Sort commits by date when possible.

–merge
After an attempt to merge stops with conflicts, show the commits on the history between two branches (i.e. the HEAD and the MERGE_HEAD) that modify the conflicted files and do not exist on all the heads being merged.

–left-right
Mark which side of a symmetric difference a commit is reachable from. Commits from the left side are prefixed with a < symbol and those from the right with a > symbol.

–full-history
When filtering history with …​, does not prune some history. (See “History simplification” in git-log[1] for a more detailed explanation.)

–simplify-merges
Additional option to --full-history to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge. (See “History simplification” in git-log[1] for a more detailed explanation.)

–ancestry-path
When given a range of commits to display (e.g. commit1…commit2 or commit2 ^commit1), only display commits that exist directly on the ancestry chain between the commit1 and commit2, i.e. commits that are both descendants of commit1, and ancestors of commit2. (See “History simplification” in git-log[1] for a more detailed explanation.)

-L,:
-L::
Trace the evolution of the line range given by “,” (or the function name regex ) within the . You may not give any pathspec limiters. This is currently limited to a walk starting from a single revision, i.e., you may only give zero or one positive revision arguments. You can specify this option more than once.

  • 1
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值