We have the following branches:master
and develop
.
We created a new branch feature
off of develop
and assigned a team to work on it.
During development:
develop
accepts new commits by other teams.feature
accepts new commits pushed by the team members working on it.Sometimes there are hot fixes pushed to develop
that need to be updated in feature
as well.
Of course, at the end of the cycle, feature
should be merged into develop
.
We don't have a single workflow to keeping feature
and it's local copies in sync with develop
, and then making sure all local copies are based on the same commit.
My suggested workflow is as follows:
Keeping up-to-date with develop
develop
I rebase the feature
branch:
git checkout feature
git pull --rebase origin develop
git push origin feature
All local feature
copies run: git pull --rebase origin feature
Updating the feature
branch from local copies
feature
branchgit pull --rebase origin feature
He merges his commits into feature
:
git checkout feature
git pull origin feature
git merge local-feature
git push origin feature
Merging the feature
branch into develop
I make sure feature is up to date with develop
:
git checkout feature
git pull --rebase origin develop
I merge into develop
:
git checkout develop
git pull origin develop
git merge feature
git push origin develop
We do all that pull --rebase
stuff in order to keep linear flow and make sure all our changes are merged using fast-forward.
However, as you can tell, there are a lot of commands to run every time.
Is this really necessary? Are we doing it the "right" way?
Would you suggest another flow?
I assume you follow this model: http://nvie.com/posts/a-successful-git-branching-model/
I think most of the demonstrated commands are correct, you can however make things easier by implementing git alliasses
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With