In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example analysis of branching and merging in GIT. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.
1. git merge
Let's look at the first method- git merge.
Merging two branches in Git results in a special commit record that has two parents. Translated into natural language, it is equivalent to: "I want to include these two parent nodes themselves and all their ancestors. "The following is a detailed explanation.
#Create a new branch bugFixgit branch bugFix#Switch to that branch git checkout bugFix#Submit a git commit# Switch back to mastergit checkout master#Commit again git commit#Merge bugFix into mastergit merge bugFix with git merge (master's branch is mixed into all commit records, bugFix is not, so do the following)#Merge master branch into bugFix again (since master inherits from bugFix, Git does nothing but simply move bugFix to the commit record that master points to) git checkout bugFix;git merge master
2. git rebase
The second way to merge branches is git rebase. Rebase is essentially taking a series of commit records,"copying" them, and dropping them one by one in another place.
The advantage of Rebase is that it creates a more linear commit history, which sounds a little hard to understand. If only Rebase were allowed, the commit history of the codebase would be unusually clear.
#Create a new bugFix branch git branch bugFix#Commit once (commit on master branch)git commit#Switch to bugFix branch git checkout bugFix#Commit once (commit on bugFix branch) git commit#Use git rebase to move work from bugFix branch directly to master branch (moving makes the functionality of both branches look like they were developed sequentially, but they are actually developed in parallel #). git rebase master Note: Commit record C3 still exists (the translucent node on the tree), and C3'is the copy of C3 we Rebase to master branch.# Switch to master branch (to update master) git checkout master#rebase master to bugFix branch (since bugFix inherits from master, git simply moves references to master branch forward). git rebase bugFix About "GIT branch and merge example analysis" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 291
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.