Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: How can I merge changes made between two tags to another branch?

I'm trying to manage our Moodle instance on our own branch of the Moodle repo. I checked out tag "v1.9.11" of branch "MOODLE_19_STABLE", then copied that to a new branch "COE", where I've added in our custom theme, etc.

Now that tag "v1.9.12" exists, I want to merge the commits up to that tag into my "COE" branch (and not the commits that came after).

Can I do this with something like git cherry-pick?

like image 912
Steve Clay Avatar asked May 20 '11 16:05

Steve Clay


People also ask

How can I selectively merge or pick changes from another branch in git?

Roughly speaking, you use git rebase -i to get the original commit to edit, then git reset HEAD^ to selectively revert changes, then git commit to commit that bit as a new commit in the history.

Can you merge tags git?

@learner a Tag identifies a specific commit. You can't merge into a specific commit so you'd need to move the tag to the commit you want.

How do I merge changes from one branch to the main?

First we run git checkout master to change the active branch back to the master branch. Then we run the command git merge new-branch to merge the new feature into the master branch. Note: git merge merges the specified branch into the currently active branch.


1 Answers

$ git merge v1.9.12

will merge all the commits up to, and including, v1.9.12, and nothing after that.

like image 78
mipadi Avatar answered Oct 01 '22 11:10

mipadi