简体   繁体   中英

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

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!

如果git merge确实按预期工作,但是您不喜欢历史记录,则可以使用--squash -flag将所有提交合并为一个,然后可以使用新的提交消息进行提交。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM