Git Branching

本文通过引用《Pro Git》的内容,详细介绍了Git分支的工作原理。当执行`git commit`时,Git会创建树对象并保存在仓库中。分支在Git中是轻量级且可移动的指针,指向特定提交。创建新分支非常简单,使用`git branch`命令即可。示例中展示了在master和newbranch两个分支上分别进行工作,彼此的改动互不影响,体现了Git分支的隔离性和实用性。
摘要由CSDN通过智能技术生成

It will be a little hard to describe Git branching well , so I may vastly reference contents from 《Pro Git》

Before the introduction of Git Branching, let’s see what git actually dose when we are making commit by running command git commit at first.
git commit tree
Figure 1.1

when you create the commit by running git commit, Git checksums each
subdirectory and stores them as a tree object in the Git repository.
Then Git creates a commit object that has the metadata and a pointer
to the root project tree so it can re-create that snapsht when needed. --《Pro Git》

You can see now we have five objects in our git repository, they are three blobs, one tree and one commit.

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值