Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Case Analysis of the ingenious use of git cherry pick

Shulou Source: shulou.com Published: 2022-06-01 04:46:01 10月03日 Update

The wonderful use of git cherry pick example analysis, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Git version management is very convenient, can not be used before. The main branch saves the code, but when there is a functional upgrade, it cannot be completed with a single change. It may take many days to complete. Basically, it will be saved once or more times a day, and do not want the main branch to be mixed with too many temporary submissions. Only the released version of the submission v0.1.0 v0.1.1 v0.1.2, etc., can not be solved by merging branches, he will bring all submissions over. The practice now is to create a new temporary branch, submit v0.1.3-0 v0.1.3-1 and so on in the temporary branch, and finally test and verify the OK and then copy the code to the main branch, overwrite it, and submit the official version.

In fact, git has a cherry git command that can select a desired commit and merge it into the main branch without bringing other unwanted temporary commit versions.

For the specific operation method, first switch to the main branch, and then right-click to view the log

Select the submitted version right button cherry pick this commit...

The desired submission is added from the temporary branch to the main branch, and then the local temporary branch and the remote temporary branch can be deleted.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Branches versions code help magic examples case analysis analysis clarity temporary practices content functions only commands articles novices methods more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Apple vpn Shulou Information