Hi: I have 2 branches master and dev which were in sync about 2 weeks ago. Would like some help on how to move a feature (commit F) to master branch now. Have been reading up a number of git workflow models, just need to make sure I have understood it right before I commit and push the changes.
2 weeks ago master
...-C-D-E
acpt
...-C-D-E
I added two hotfixes (H1 and H2) on two different dates, while working on another feature (commit: F) at the same time. So the branches look like this master
H2
/
H1
/
...-C-D-E
dev
H1 H2
/ /
...-C-D-E-F
My questions are the following
1. Now I want to move F to master. I was going to do git merge dev
while in the master branch. Is there anything wrong with this
2. Or should I be doing git merge <commit-id for F>
while in the master branch.
3. Or should I be developing F in a new branch and merging that branch into master and dev
As far as I understood from your development workflow, you are working with gitflow workflow. In this workflow the main branches are:
If you were working on development instead of feature branches, then you have to merge development to master first and then follow the workflow. To answer your question: better to use first option:
git checkout master
git merge dev //to merge dev into master
And then push to remote master.
To make github happy (if you use github), you have to merge master back to development (so it would not diverge and will not complain).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.