How to perform merge?

情到浓时终转凉″ 提交于 2019-12-01 11:47:02
checkout master
checkout -b develop (assuming you don't already have a develop branch)
merge --no-ff your-feature-branch

Resolve any conflicts in code. Test, test test.

checkout master
merge --no-ff develop

Then deploy your code.

I really like this branching model since it always keeps me building features on feature branches, doing final testing on develop. And only ever merging into master. No commits happen on master.

Don't do back merges. Integrate on an integration branch. Test completed branches on a release candidate branch. Only merge to master when you release a release candidate. You merge the release candidate that was deployed.

More on this here:

https://plus.google.com/109096274754593704906/posts/R4qkeyRadLR

UPDATE

I rewrote this here:

http://dymitruk.com/blog/2012/02/05/branch-per-feature/

Both result in same state for master. Its just that feature branch is brought to same state as master in first case and remains unaffected in second case.

If you are asking which one to do, then doing the first is preferred way. You should merge master "into" feature first, so that any bugs after merging do not affect the master. Keeps the master clean. This also ensures that there are no merge conflicts in the master ever.

This is my general practice: Merge master into any feature branch and check that everything works fine. If something is broken, fix it. Then merge the latest master again. Only after the merged branch seems good, that this is put into master.

I would rebase feature on top of master, then fast-forward feature on top of master

(with feature checkedout)

git rebase master
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!