PUSH all local GIT branches? Best Practice?

2019-03-26 13:46发布

Should ALL locally created GIT branches be pushed to the central-repository on a daily basis? What is best-pracice workflow concerning this?

We created a GIT repository to manage our large e-commerce site, which is under continual development by a large team.

The central repository is at 'Beanstalk' and we have three primary branches, 'prestaging' (master), 'staging' and 'production'. All development should be merged into prestaging when it is completed locally and ready to be published.

I can see pushing long-running branches to Beanstalk as well. However some of our team advocates pushing ALL local development branches to Beanstalk on a daily basis in-progress or not; to create redundancy. I think this would clutter the repository with hundreds of branches over time. What is best practice?

3条回答
Evening l夕情丶
2楼-- · 2019-03-26 14:15

I agree with you, using a central repo for backup of daily work is a bad idea. It should hold commits meant to be shared, tested or released.

Backup of daily work should either happen to another repo, more permissive, with optionally an automated git push --force --all backup-repo task on each dev machine, or have them a more classic backup tool.

查看更多
Deceive 欺骗
3楼-- · 2019-03-26 14:29

I prefer not polluting the central repo with all branches of all users.

Don't mix:

查看更多
相关推荐>>
4楼-- · 2019-03-26 14:33

You can always have the user clean up their remote branches when they are done with it. It's not a bad idea to have them push their local branches up just for safe keeping (especially if there is no backup solution on their box). Otherwise if their machine dies their local branch is gone.

查看更多
登录 后发表回答