http://www.gitguys.com/topics/branches-visualizing/

源自:http://www.gitguys.com/topics/branches-visualizing/

Visualizing Branches And Their Commits

Commands discussed in this section:

  • git show-branch
  • gitg, gitk and qgit

Our Example Repository

Let’s start with the repository we created in the Creating And Playing With Branches section.

The master branch:

  • Commit C1: Created the file README with the contents: This is the README file.
  • Commit C2: Added one more line to the README file: One more line.
  • Commit C3: Created the file Makefile with the contents: #Beginnings of a Makefile

The test branch started with the master branch commit C2:

  • Commit T1 created the file Makefile with the contents: My system test

Visualize it

The below diagram shows the 2 branches and what occurred during each commit:

annotated

Depending on the platform where you’re running git, there are various GUIs that graphically show the branch history. Below is an example of the repository shown by running gitg –all (the –all flag is used to show all branches, instead of only the current branch):


gitg

In the top left area of the above image, below the word Subject, each circle represents a commit.

The most recent commit (“Added a Makefile“) on the master branch has been selected and highlighted. The actual changes to the repository for that commit are shown in the lower section of the window.

Is that nice, or what?

In addition to gitg, other git UIs that are common on Linux are gitk and qgit.

Both windows and MacOS versions of git also include a GUI, as mentioned in Where Do I Get Git?.

The git show-branch command can also be used: Decipher git show-branch to see branches and their commits


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值