A coworker uses a git merging strategy that I'm unfamiliar with and seems kind of unusual, and I'm trying to make sure that I understand how merges work. My understanding is that the normal flow is this:
- checkout a new branch from
master
- work on that branch for a while
- when you're done, checkout
master
the work branch, and rungit merge <work-branch-name>
I also get that if your work branch has been running for a while, you may merge master
into that branch periodically to keep it up to date with other changes.
What my coworker does is for the final merge is git checkout master; git merge <work-branch-name>
. This results in a network like this one. Where the black branch would normally be master, in this image it's actually the work the coworker did on their work branch, while blue is the work done on master.
So the question is: does this flow have any downsides? The rest of the team does the more traditional "merge into master
" or rebasing. My thought is that the coworker's work might get overwritten, if someone else on the team makes changes on the master
branch in the same places that the coworker has edited in their branch. Anything else I might be missing?
(FYI, this is a copy of my question here).
ETA: fixed which branch one checks out prior to the merge
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/git/comment...