简体   繁体   English

在快节奏的环境中从SVN切换到Git

[英]Switching from SVN to Git in a fast-paced environment

The development team I am part of consists of five members in a fast-paced in-house development environment (we develop web-based solutions that is used by other departments, ie an ERP.) We currently use SVN for a single project which has a development environment and a live environment; 我所属的开发团队由一个快节奏的内部开发环境中的五个成员组成(我们开发基于Web的解决方案,供其他部门使用,即ERP)。我们目前将SVN用于单个项目,该项目具有开发环境和生活环境; the development environment allows us to ensure that features are working before pushed to the live environment. 开发环境使我们能够确保功能在发布到实际环境之前能够正常工作。 When the requirements are met, we commit the changes to the SVN repository from the development server and pull those specific changes onto the live server. 当满足要求时,我们将更改从开发服务器提交到SVN存储库,并将这些特定更改拉到实时服务器上。

当前使用SVN的工作流程

We do the testing on dev until the code reaches a stable point to commit. 我们对开发人员进行测试,直到代码达到稳定的提交水平。

We want to switch to Git, however (a lot of our other projects are housed on Git, and we want it to be consistent.) It has been a bit of a challenge. 但是,我们想切换到Git(许多其他项目都放在Git上,并且我们希望它保持一致。)这是一个挑战。 We want to have a workflow that is easy and quick to use and track. 我们希望拥有一个易于使用和跟踪的工作流程。 I suggested having two main branches for live (master) and dev, and having each feature / fix in their own branches. 我建议为live(master)和dev创建两个主要分支,并将每个功能/修复放在自己的分支中。 This makes things better to track but harder to put in place, as it takes a lot longer and some of the changes we make to the code need to be pushed live as quick as possible. 这使事情更容易跟踪,但又难以放置,因为这需要花费更长的时间,并且我们对代码所做的某些更改需要尽快发布。

Another suggestion was to have only a dev and live branch. 另一个建议是只拥有一个开发人员和一个正式分支。 We would commit to the dev branch, ensure they work, then once we are satisfied with the result, merge those files into live. 我们将提交到dev分支,确保它们可以正常工作,然后对结果感到满意后,将这些文件合并为活动文件。 The only thing with this one is I am unable to find a decent way of implementing this behaviour. 唯一的问题是我无法找到一种实现此行为的体面方法。 Is it possible to quickly merge specific files from one branch into another? 是否可以快速将特定文件从一个分支合并到另一个分支?

Are there any other git workflows that would be more suitable for our kind of environment? 是否还有其他git工作流程更适合我们的环境?

Both of the two suggestions you list can work, but the two workflows can be improve with the below workflow: 您列出的两个建议都可以使用,但是可以通过以下工作流程改进两个工作流程:

  • develop branch: all the developers work on this branch. develop分支:所有开发人员都在该分支上工作。 When the changes are ready to deploy for live environment, the developer can push his changes to live ( master ) branch. 当更改准备好部署到实时环境中时,开发人员可以将其更改推送到livemaster )分支。
  • Feature/hotfix branches: are the shorting living branch for developers on their local repo. 功能/修补程序分支:是开发人员在其本地存储库上的短期生存分支。 Such as if a developer want to develop new functions or fix bugs, he can create local feature/hotfix branch from develop branch. 例如,如果开发人员想要开发新功能或修复错误,则可以从develop分支创建本地功能/修补程序分支。 After finishing the work, merge the feature/hotfix branch into develop branch. 完成工作后,将功能部件/修补程序分支合并到develop分支中。
  • live / master branch: it works as the production/released versions. live / master分支:它是生产/发行版本。 After codes are verified on develop branch, then the develop branch can merged into live / master branch. develop分支上验证代码后,然后develop分支可以合并到live / master分支中。

The differences among the two suggestions you list: 您列出的两个建议之间的差异:

  1. It's also has two main branches ( develop and live / master ) as the first suggestion, but it only has feature/hotfix branches for develop branch since live / master branch work as production/release version. 它也有两个主要分支( developlive / master )作为第一个建议,但是由于live / master分支是生产/发行版本,因此它仅具有feature / hotfix分支来进行develop分支。
  2. This workflow is not make changes on develop branch directly. 该工作流不是直接在develop分支上进行更改。 It works on feature/hotfix branches, and then merging the changes into develop branch. 它适用于功能部件/修补程序分支,然后将更改合并到develop分支中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM