How should you keep a shared develop branch up to date with upstream changes on git?

匿名 (未验证) 提交于 2019-12-03 01:45:01

问题:

I've done a ton of reading on this, but still can't seem to get my head (no pun intended...) around it.

Where you have a branch that is a) a branch that many people pull from (a common develop branch for example) and b) a branch downstream from changes that you want to regularly integrate into that branch: how do you keep it up to date? It seems that git merge is going to create a very messy history (that you'd then integrate with your master), but git rebase is untenable given multiple people pull from that branch.

For example, the Develop branch here (needs to integrate changes from Stable + multiple branches refer to it): http://blogs.remobjects.com/blogs/mh/2011/08/25/p2940

Possible (but imperfect) solutions I could see include: not keeping your develop branch up to date, cherry picking commits that occur upstream.

Thanks!

回答1:

If git merge does work as expected but you don't like the history, you can use the --squash-flag to combine all commits into one you can commit with a new commit message.



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