PUSH all local GIT branches? Best Practice?

前端 未结 3 1558
轮回少年
轮回少年 2021-02-14 17:32

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

相关标签:
3条回答
  • 2021-02-14 18:13

    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.

    0 讨论(0)
  • 2021-02-14 18:31

    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.

    0 讨论(0)
  • 2021-02-14 18:32

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

    Don't mix:

    • publication workflow: what you choose to publish (push/pull to an upstream repo)
    • backup need: use a bundle (See "Backup a Local Git Repository"), that way you have only one file to copy to any remote drive you want.
    0 讨论(0)
提交回复
热议问题