简体   繁体   中英

How sync work using git-flow

I and my co-worker are working to a project. There is a --bare remote repo from which we have cloned to our pc. Then we have both initialized own personal repos with git-flow. Now I have develop and master branch.

Which branch shoult I use to sync my work with my co-worker?

If I not always commit all my changes in feature branches, my develop branch is dirty and I can't push it to sync. The alternative that we use is create a new feature branch called "sync release" every time I want sync my work. Then the closure of the feature branch update the master branch and I can sync it (not the dirty develop branch).

This is our current workflow. What is the correct git structure when all developer use git-flow and want share the work correctly?

Syncing the develop branch is probably the best approach as it shields you away from unfinished features your co-worker is still working on.

If your local develop branch is dirty at any given moment, git stash can help you to save away you local work temporarily (and use git stash pop to take it out again after the sync).

Having said that, bear in my the git is a distributed system and, as such, you can both sync and work on a feature in progress without going through the “central” repo.

See for example the description in nvie's original description of git-flow “Decentralized but centralized” :

nvie的“分散但集中化”插图

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