We have the following branches in our project:
- master
- preproduction
- production
We use branches like feature/myfeature-123 to develop new function. If they are done, we merge those into the master. After a while, when enough features are done and successfully merged into master, we deploy our project to preproduction. For this, we need to merge the latest changes into the preproduction branch.
Note: Nothing was changed in the preproduction branch in the meantime
And here is our problem: We face many merge-conflicts. Then i thought, okay. Lets fix it manually. I did the following:
- Checkout preproduction
- (Just to be safe) Pull the latest changes in this branch (There were none)
- Create a new branch from the current branch i am in. Name: deployment-april2019
- Switched to this new branch
git pull origin master
to get the current state frommaster
into this branch.
As stated above, we face a lot of merge conflicts. Since we changed nothing in the preproduction branch, i wanted to accept all changes that were done in the master branch. This should fix all conflicts.
This worked, BUT in the master branch we deleted several files / lines that were also in the preproduction branch. I would have expected, that those deleted files / deleted lines would also be applied to the preproduction branch. But this was not the case. They stayed in the preproduction branch. Any ideas what to do, to solve this?
I am not the biggest expert in this. I have a general understanding of Git, but i am still afraid of breaking things by executing the wrong commands. I thought if rebase
could help here, but i dont know.
I am very thankful for any help you can provide.