![]() The possible merge conflicts and the content of the end result will be the same as the cherry-pick, you would obviously have to pick the content of that commit on top of your actual my/work branch.Īs you can see from the diagram : the merge base for the cherry-pick must be p, so you won't be able to create a PR against your initial my/work branch, which gives the same result as the cherry-pick. What to do with the result of this merge ? You would merge cherrypick/source in cherrypick/target You would want a branch cherrypick/source at eacf32 : git branch cherrypick/source eacf32 I want to cherry-pick in a commit from another branch, named 'zebra'. In the list of branches, click the branch that has the commit that you want to cherry-pick. For more information, see Distributed Git - Maintaining a Project in the Git documentation. The documentation describes git cherry-pick as Apply the changes introduced by some existing commits. On my local machine, I'm currently on my 'master' branch. Some projects incorporate contributions by cherry-picking commits. How to Use git cherry-pick The Git command documentation is not necessarily intuitive, but it is absolutely accurate. # ('-soft' will keep all the differences as staged changes) : How to cherry-pick from a remote branch Ask Question Asked 10 years, 7 months ago Modified 1 year, 1 month ago Viewed 283k times 214 I'm having trouble performing a cherry-pick. # use 'reset -soft' to move to the parent of eacf32 You would want a branch cherrypick/target, with the actual content of my/work, grouped as one commit on top of p - the parent commit of eacf32 : # start from your branch (you will have the expected content) : This flag applies the changes necessary to cherry-pick each named commit to your working tree and the index, without making any commit. See git cherry-pick -help: -n, -no-commit Usually the command automatically creates a sequence of commits. ![]() ![]() ![]() # 'git cherry-pick eacf32' will try to resolve this merge : You can still use the git cherry-pick command. Suppose you run git cherry-pick eacf32 from branch my/work : # 'p' marks the parent commit of eacf32 : Here is my go at illustrating the merge operation performed by git cherry-pick : A cherry-pick tries indeed to merge two patches together, but you will not be able to create a merge request on your work branch that does the same action as the cherry-pick. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |