nvie / gitflow

Git extensions to provide high-level repository operations for Vincent Driessen's branching model.
http://nvie.com/posts/a-successful-git-branching-model/
Other
26.63k stars 2.66k forks source link

fetch develop before merge #416

Open fabb opened 9 years ago

fabb commented 9 years ago

Git flow helps a lot, but one thing impairs the workflow: "Finish Feature" does not take care that develop has been pulled and is the most recent version from origin.

At the moment our workaround is before doing "Finish Feature", executing fetch origin develop:develop to ensure develop is the most recent version, and the merge commit will not diverge from origin.

It would be awesome if pulling develop would be a part of the gitflow action "Finish Feature" - at least with an option.

srt32 commented 9 years ago

Have you tried changing the gitflow.feature.finish.fetch settings?

The docs explain it here: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments#default-to-fetching-before-local-operations. Will that change do what you want?

fabb commented 9 years ago

Interesting, did not know that setting. Tried it, but didn't work though. No matter if I'm on develop or the feature branch, when I finish the feature, nothing is fetched.

Output on feature finish is still:

Your branch is behind 'origin/develop' by 1 commit, and can be fast-forwarded. (use "git pull" to update your local branch)

git-flow version: 0.4.1

davewo commented 9 years ago

It appears that the gitflow.feature.(start|finish).fetch config is never read with a git config --get .... Only the command line option works. To be clear, this option will only fetch, it will not actually merge origin/develop into your local develop.

davewo commented 9 years ago

https://github.com/nvie/gitflow/pull/434 allows git flow feature, release, and hotfix to read your git configuration for an option called "fetch". https://github.com/nvie/gitflow/pull/434 does not satisfy this issue specifically (does not attempt a merge after fetch), but at least now the wiki won't be lying :-)