0

I need to merge from one branch to another but only between selected tags in Git

your help highly appreciates.

2
  • A branch is not a chain of commits; it is the name of one commit. Do you mean you want to cherry pick the tagged commit? Commented Dec 10, 2019 at 4:06
  • @matt thank you for your reply, In my scenario, I am maintaining a different branch to different version so I need to merge selected commits from the master branch. To identify the selected commits I have added two tags from start commit to ending commit. as per my understanding cherry-pick can only merge only selected commits not the set of commits. Commented Dec 10, 2019 at 4:13

1 Answer 1

4

as per my understanding cherry-pick can only merge only selected commits not the set of commits

git cherry-pick can apply a set of commits, as I describe in "How to cherry pick a range of commits and merge into another branch?"

In your case:

git cherry-pick tag1^{}..tag2^{} 

{}^ is the dereference notation.
Make sure that tag1 reference the oldest commit.
And understand this will not move the tags, which will still reference their original commits.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.