具有通用存储库的工作流许多人使用的工作流程是所有开发人员推"(将其更改)发送到一个公共存储库,并从该存储库中获取所有更改.像这样:开发者A推向中心开发者B推向中心开发人员C拉动(从A和B中获取更改)开发人员A拉动(从B获取更改) ... 在这种情况下,中央存储库可以位于开发人员计算机之一,github上或任何其他地方电子邮件工作流程您还可以在不使用任何服务器的情况下使用git,而仅使用电子邮件.在这种情况下,流程如下:开发人员A将更改作为电子邮件发送给团队其他开发人员应用电子邮件中的更改这甚至可以半自动化的方式完成没有中央服务器的工作流程您可以将git设置为使用多个远程"菜单.资料库.需要注意的是,您不应该从不推送到已签出的存储库(即有人正在使用的开发人员副本).因此,在这种情况下,流程将如下所示:开发者A进行更改开发人员B进行更改开发人员C从A提取更改开发人员C从B提取更改开发者B从A提取更改 ... 没有人可以推动恕我直言,这种类型的工作流程将迅速导致混乱和崩溃.Git is supposed to be a decentralized system, but all the tutorials andbest 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 finda 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? 解决方案 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 workflowsWorkflow with common repositoryThe 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 centralDeveloper B pushes to centralDeveloper 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 placeWorkflow with EmailYou 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 teamOther developers apply the changes from the emailsThis can even be done in a semi-automated wayWorkflow without a central serverYou 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 changesDeveloper B makes changesDeveloper C pulls changes from ADeveloper C pulls changes from BDeveloper B pulls changes from A...No one must ever pushIMHO this type of workflow will quickly lead to confusion and breakdown. 这篇关于没有服务器的Git工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-16 03:03