Get the App
SLTechnology News&Howtos  ›  Development  › 

Case Analysis of branching and merging of git

Shulou Source: shulou.com Published: 2022-06-01 14:35:37 09月19日 Update

This article mainly introduces the relevant knowledge of "branch and case analysis of git". The editor shows you the operation process through the actual case. The operation method is simple, fast and practical. I hope this article "branch and case analysis of git" can help you solve the problem.

Once a branch has independent content, you will eventually want to merge it back into your main branch. You can merge any branch into the current branch using the following command:

Git merge$ git branch* master newtest$ lsREADME test.txt$ git merge newtestUpdating 3e92c19..c1501a2Fast-forwardrunoob.php | 0test.txt | 1-2 files changed, 1 deletion (-) create mode 100644 runoob.phpdelete mode 100644 test.txt$ lsREADME runoob.php

In the above example, we merge the newtest branch into the main branch and the test.txt file is deleted.

After the merge, you can delete the branches:

$git branch-d newtestDeleted branch newtest (was c1501a2).

After deletion, only the master branch is left:

This is the end of $git branch* master's introduction to "branch and example analysis of git". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Tags: Branches examples case analysis analysis knowledge content industries different practical can make commands practicality actual documents articles methods more cases for knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker Huawei OPPO Reno MySQL