Merging a new feature

49 views
Skip to first unread message

Kunzmann

unread,
Aug 31, 2010, 12:32:26 AM8/31/10
to gitflow-users
So I'm ready to merge a new feature into the develop branch:

$ git checkout develop
# Switched to branch develop
# Your branch is behind 'origin/develop' by 2 commits, and can be fast-
forwarded.

Assuming there will be conflicts, these are the options I'm aware of:
A. update the local develop branch before merging the new feature, and
deal with conflicts during the feature merge
B. merge the new feature into the out-of-date local develop branch,
and deal with conflicts when merging 'origin/develop'

Does it matter which option I choose? Is one better than the other?

If option A is the way to go, should I use "git pull --ff origin
develop"?

Forgive the new git-flow user if this is a stupid question...

Cheers,
Joshua

Terin Stock

unread,
Aug 31, 2010, 12:38:19 AM8/31/10
to gitflo...@googlegroups.com
I believe the correct thing to do is

$ git flow feature finish <feature_name>
--
#Terin Stock
Undergraduate, Computer Science (CISE), University of Florida

Vincent Driessen

unread,
Aug 31, 2010, 12:43:51 AM8/31/10
to gitflow-users
Hi Joshua,

Option A would definitely be the best. You have to deal with the
conflicting change either way. Using option A, however, you keep the
commit history tree a bit simpler, because you combine the feature
merge and the conflict resolution into a single merge commit. Using
option B creates two merges: first you get a feature merge commit
(because of "git flow feature finish"), then you get a merge commit
because you merged from upstream.

Always make fast-forward merges first, as they are smooth and don't
create complex history trees unnecessarily. It's good to realize that
this is by no means related to the use of the git-flow tool—it's just
vanilla Git best practice.

Cheers,
Vincent
Reply all
Reply to author
Forward
0 new messages