How to avoid merge conflict when working on related tickets

Multiple related tickets in Code Review (cr)

Scenario:

  • As Developer I worked on tix #1 pushed to remote repo. Code Reviewer merged tix to master branch.

  • As Developer I worked on tix #2 which is related tix #2. Before working on tix #2 I ran git merge –no-ff dev and it returned Already up-to-date. I saw that one of the files from tix#1 did not have the changes to a few lines. So I added the same changes to that file while working on tix #2. Then I pushed to remote repo. Code Reviewer informs me that this caused a merge conflict. CR says I should have pulled before working on tix#2.

I was told to merge master into the feature branch before working on the feature branch. Would git pull in the feature branch the right thing to do? What happens when you git pull in a feature branch?

Signed,
Inquisitive Minds Need To Know

Looks like there’s a typo in your second bullet. I think you said ticket #2 when you meant ticket #1 at one point. I want to make sure I understand the question before replying, so can you correct it?

Thanks!

Also: can you specify what branch you were in when you did this?

You are right there is a typo.

As Developer I worked on tix #2 which is related tix #2.

should be

As Developer I worked on tix #2 which is related tix #1.

I was working on a feature branch I created let’s say FY-001 while making the changes to tix #1 & tix #2.

Does that help?