Git工作流程:没有服务器 [英] Git Workflow: Without a server

查看:178
本文介绍了Git工作流程:没有服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

git应该是一个分散的系统,但我在google上发现的所有教程和
最佳实践工作流程都建议使用服务器
(通常是github,或者自己设置) p>

我为小型个人项目(2-3人)使用git,在哪里可以找到
a最佳实践工作流程,以便在团队成员机器之间直接同步更改。
另外,为什么我应该避免这种情况,并建立一个中央服务器,有什么有说服力的论点?



谢谢,

解决方案

取决于服务器的含义。 Git会在没有中央服务器的情况下快乐地工作,尽管许多团队发现使用中央存储库很方便。



如果用server表示安装服务器软件, git也可以在没有任何特殊软件的情况下(通过ssh或在文件系统上)工作(不管是中央存储库还是不存在)。


$ b

请参阅此文档以了解可能的工作流程

公共存储库



许多人使用的工作流是所有开发人员将其更改推送(发送)到公共存储库,并从该存储库获取所有更改。像这样的东西:




  • 开发人员A推到中央

  • 开发人员B推到中央
  • >
  • 开发者C拉(从A和B获取更改)

  • 开发者A拉(从B获取更改)
  • ...



在这种情况下,中央存储库可以位于开发人员计算机上,github上或任何其他位置使用电子邮件的工作流程

您也可以在没有任何服务器的情况下使用git,只需使用电子邮件即可。在这种情况下,流程将如下所示:




  • 开发人员A将更改作为电子邮件发送给团队
  • 其他开发人员应用来自电子邮件的更改



这甚至可以以半自动方式完成

b
$ b

没有中央服务器的工作流程



您可以设置git使用多个远程存储库。需要注意的是,您应该永不 推送到已签出的存储库(即,某人正在开发的Developer副本)。所以在这种情况下,流程将如下所示:


  • 开发人员A进行更改

  • 开发人员B进行更改

  • 开发人员C从A取得更改

  • 开发人员C从B取得更改
  • 从A

  • ...的变化...

  • 任何人都不得推送


恕我直言,这种类型的工作流程将很快导致混乱和崩溃。

git is supposed to be a decentralized system, but all the tutorials and best practice workflows I have found on google suggest using a server (usually github, or else set up your own)

I am using git for small personal projects (2-3 people), where can I find a best practice workflow for syncing changes directly between the team members machines. Alternatively, what are some compelling arguments for why I should avoid this and instead set up a 'central' server?

Thanks,
Ben

解决方案

Depends on what you mean by "server". Git will work happily without a central server, although many teams find it convenient to have a central repository.

If by "server", you mean "install server software", git will also work (central repository or not) without any special software, through ssh or on the file system.

See this document for possible workflows

Workflow with common repository

The workflow that many use is that all developers "push" (send) their changes to a common repository, and get all the changes from that repository. Something like this:

  • Developer A pushes to central
  • Developer B pushes to central
  • Developer C pulls (getting changes from A and B)
  • Developer A pulls (getting changes from B)
  • ...

In this case the central repository can be on one of the Developers computers, on github, or any other place

Workflow with Email

You can also use git without any server, just using email. In this case the flow would be like this:

  • Developer A sends changes as an email to the team
  • Other developers apply the changes from the emails

This can even be done in a semi-automated way

Workflow without a central server

You can setup git to use more than one "remote" repository. The caveat is that you should never push to a repository that is checked out (that is, a Developer copy on which someone is working). So in this case the flow would be like this:

  • Developer A makes changes
  • Developer B makes changes
  • Developer C pulls changes from A
  • Developer C pulls changes from B
  • Developer B pulls changes from A
  • ...
  • No one must ever push

IMHO this type of workflow will quickly lead to confusion and breakdown.

这篇关于Git工作流程:没有服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆