简体   繁体   中英

Mixing private and public repository in Git workflow

I guys,

I'm fairly new to Git and I'm trying to setup a workspace and workflow. Could someone give me some advice please. I believe that with Git everything is possible but I want to follow the rules here.

So I use Github to host one public and one private repository. The public repository is my project's official code and the private one is used only by me so I can work on different computers.

I want to work as much as possible on my private repository. Here I have branches where I investigate some ideas.

When I want to release something I want to pick some commits from my private repository and merge them to public. I also want that my public changes appear as one single commit without any history.

I've been reading and I think rebase is the way to go when sending stuff into public so I can pick and squash what I want.

What do you guys think? Is this doable? or it has any major issues? I guess I could try it but I don't want to get stuck in something that isn't right to begin with.

Everyone should read Pro Git by Scott Chacon before tackling any sort of project with Git. Without wanting to plug his book beyond a strong recommendation, he pretty somes up this workflow on p124.

Totally doable.

Treat your private as your dev fork and your public as your production fork. Be really strict with merges between the two.

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