0

The solution for "Keep feature branch up to date" with git is, to merge the master into the feature branch from time to time, for example if a there is a change implemented in the master branch which is needed by the feature branch, correct?

I have done that once. So my history looks like:

master feature

now i want to merge
| |
| | file needsToBeChangedForNewFeature.php was changed here again
| |
|/| i get a conflict for each change since this point
| |
| | file needsToBeChangedForNewFeature.php was changed here
| |
|/
|

Now i want to finally merge this feature branch into the master, but i am getting a conflict in file "needsToBeChangedForNewFeature.php" for every line which was changed twi times (see git history example).

This seems somehow logic to me, as git cannot decide if to keep the semi-new or the really new version of the file.

So to sum up: older changes of a file in the feature branch are conflicting with the latest changes of the same file in the same feature branch.

But how can i avoid this?

Thanks a lot.

4

1 回答 1

0

在最终合并之前,master 中的功能应该没有变化,因此不会有任何冲突(除非有人独立开发其他东西)。从您的描述来看,您似乎以某种方式复制了您在 master 中的更改,这是您不应该做的。

于 2017-07-01T12:56:13.277 回答