How to make sure my git repo code is safe?

前端 未结 7 1639
余生分开走
余生分开走 2021-01-02 19:17

If our organisation were to switch from a central-server VCS like subversion to a distributed VCS like git, how do I make sure that all my code is safe from hardware failure

7条回答
  •  清歌不尽
    2021-01-02 19:22

    All developers on your team can have their own branches on the server as well (can be per ticket or just per dev, etc). This way they don't break the build in master branch but they still get to push their work in progress to the server that gets backed up.

    My own git_remote_branch tool may come in handy for that kind of workflow (Note that it requires Ruby). It helps manipulating remote branches.

    As a side note, talking about repo safety, on your server you can set up a post-commit hook that does a simple git clone or git push to another machine... You get an up to date backup after each commit!

提交回复
热议问题