In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 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 what is the difference between merge and rebase in git. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Git branches are created and merged, and when branches are merged, there are two ways: git merge and git rebase.
Git merge: merge two branches into a new commit, and the new commit has 2 parent.
Git rebase: cancels each commit in the branch, temporarily stores them, updates the current branch to the latest origin branch, and finally applies all commits to the branch.
Git merge
Specific operation: bob is modified twice in index1.html and submitted to remote warehouse; lilei is modified twice in index.html and submitted to remote warehouse; bob pulls remote warehouse (git fetch origin dev) and merge merges. The branch structure is as follows:
Thus, the two branches are merged, and the 93a6d33 submission has two parent (135b375 and 8b61b04).
Git rebase
Specific operation: lilei is modified twice in index.html and submitted to the remote warehouse; bob is modified twice in index1.html and submitted, pulled remote warehouse (git fetch origin dev), rebase merge. The command line output is as follows:
First move the HEAD pointer to the top of the current origin branch, and then apply all commits to the current branch. The branching structure (linear) is as follows:
It can be seen that in rebase, the current branch cancels 191b8cd, 00e08ec and two subsequent submissions on the basis of the common ancestor of 135b375, with a total of four submissions. Then move the HEAD to the 322ca9 submission and reapply the four submissions to the branch.
So much for sharing what is the difference between merge and rebase in git. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can 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: 0
*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.