git - Avoid merging issues on developers's feature branches from messing up master branch's history -
we migrated svn -> git (using stash) . after migration , have started seeing issues during merge developers messing merge on feature branch.
**our workflow model:-** master 1---2----3------------4----5 | | | | | | | | m | | | feature1 | a--------b--- | | | m | feature2 c-----------------d-------
in above figure lets developer1 has feature branch feature1 , has done changes , merged develop.
developer2 has branch created before developer1's branch going around longer time. once changes done, pulls in changes master branch , resolves conflicts , merges in.
the problem when developer2 merges changes local branch resolving merge conflicts preferring own files. however, overriding of files has not changed . when creates pull request , merges master, rolls changes of developer1 previous version. can fire out because file rolls previous commit (sha) id
the question is,
- is there way can avoid systematically i.e ask git reject changes master change sha id rollback.
- is there way during merge when developers conflicts on files have changed
my googling brought me articles suggested doing git pull --rebase option or changing permission on master branch allow fast-forward merges. either of options helps.
welcome git. realise it's not magic, merging issues haven't disappeared, , still need merge did.
the answer ensure developers merge correctly, , no tool in world force that. it's people problem ultimately.
i recommend code reviews mandatory push requests origin, or merging master. 1 of reviews inspect history see if such overrides has occurred appropriate censures.
Comments
Post a Comment