In git how to merge the Feature branch into Main branch and then Resynchronize

51 views Asked by At

We have a feature branch "feature" created from the main branch "main".

We did changes in "feature" and then merged into "main"

In the meantime others also merged their changes in "main". If we want these changes in "main" to also come back to "feature" what is the best way - i.e. we want to resynchronize "feature" with "main"

1

There are 1 answers

0
Hellma On

My suggestion: Check out the main branch again:

git checkout main

Pull the latest changes:

git pull

Check out feature branch again and merge main into feature branch:

git checkout feature
git merge main

You can do this quicker, but this is the - to me - most intuitive way.