I have develop and main branches on gitlab. I want to create a merge request from develop to main includes a part of commits. Some of commits should be in merge request. What should I do?
I tried git cherry pick but it take a lot of times
I have develop and main branches on gitlab. I want to create a merge request from develop to main includes a part of commits. Some of commits should be in merge request. What should I do?
I tried git cherry pick but it take a lot of times
If you want to keep most commits on the dev branch, you could instead remove the commits you do not want.
I would suggest creating a new working branch to not lose any commits (as a copy of develop
) and then removing all commits you do not want to merge from that branch.
You can remove commits by rebasing whatever comes after that commit on the commits parent, see How do I delete a commit from a branch?.
git cherry-pick
is the way to go if you only intend to include some of the commits from a branch... you need to set them apart and then cherry-pick should do it.... you might also consider creating a different branch using rebase interactive to select which commits to include.... say, something like: