Strategy For Keeping Git Feature Branches Up to Date

丶灬走出姿态 提交于 2019-12-22 06:37:55

问题


I like to keep my feature branches up to date with develop. Is there anything wrong with frequently doing "git merge --no-ff develop". And then at the end, running "git flow feature finish feature1". These feature branches are shared (which means it is possible that someone else could be working on it, or that I'm developing out of it at my computer at home), mostly because I like knowing that they are backed up somewhere else. If they weren't shared, would consistently rebasing be preferred?

Or is it better to not keep your feature branches up to date and just merge everything in at the end?


回答1:


If your branches aren't public, updating via rebase is the best method. If they are public, it's better to just merge them at the end (rather than consistently merging changes into them). Both strategies keep a simple, clean commit and merge history.




回答2:


Yes, I think consistently rebasing would be the preferred method. And git-flow currently has a command that serves this purpose (not sure if this command was around when the question was asked): git flow feature rebase <featurename>.




回答3:


This is how I adapted git-flow for a more powerful version:

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

ymmv depending on how granular your work is.



来源:https://stackoverflow.com/questions/8418965/strategy-for-keeping-git-feature-branches-up-to-date

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