简体   繁体   English

关于使用git-svn repo的团队的工作流程的问题

[英]Questions on workflow for a team using a git-svn repo

I've bee reading up on git and git-svn. 我正在阅读git和git-svn。 I'm pretty new to git but I've been able to create some basic repos. 我对git很新,但我已经能够创建一些基本的回购。 However, I'm a bit confused on how the workflow would go for git-svn being used by a team. 但是,我对团队使用git-svn的工作流程有点困惑。 The goal is to convert svn to git for branching and sharing purposes, then commit back to the main svn repo when ready to push to production. 目标是将svn转换为git以进行分支和共享,然后在准备推送到生产时返回主svn repo。 Here are my questions: 这是我的问题:

Should each member of the team create a git repo from the svn repo? 该团队的每个成员是否应该从svn repo创建一个git repo? Would this approach work when merging back to svn / pulling from each other? 这种方法在合并回到svn / pull时是否会起作用?

-or- -要么-

Should one git repo be created from svn, then that repo is pushed 'publicly' for team members to clone? 如果从svn创建一个git repo,那么该repo会被“公开”推送给团队成员进行克隆吗? Then would changes be pulled back to the original git repo for rebasing and pushing to svn? 然后将更改被拉回原来的git repo进行变基并推送到svn?

-or- -要么-

Can we do the same as above except just pull changes from each other's working copy repo? 我们可以像上面那样做,除了从彼此的工作副本回购中拉出变化吗?

-or- -要么-

Am I adding too much complexity to the workflow and should just keep using svn, since it's not an option to just convert entirely to git? 我是否为工作流添加了太多的复杂性,应该继续使用svn,因为它不是一个完全转换为git的选项?

Do developers ever have the need of a local repo while not being able to connect to the main repo? 开发人员是否需要本地仓库,而无法连接到主仓库? (ie: Coding on a plane on a laptop) (即:在笔记本电脑上的飞机上编码)

If no, then I'd avoid this headache altogether and just use SVN with dev-specific branches. 如果不是,那么我会完全避免这种头痛,只需将SVN与特定于dev的分支一起使用即可。

If however, you'd really like the distributed approach of git, I would go with your third option: 但是,如果您真的喜欢git的分布式方法,我会选择第三种方法:

Should one git repo be created from svn, then that repo is pushed 'publicly' for team members to clone? 如果从svn创建一个git repo,那么该repo会被“公开”推送给团队成员进行克隆吗? Then would changes be pulled back to the original git repo for rebasing and pushing to svn? 然后将更改被拉回原来的git repo进行变基并推送到svn?

With: 附:

Can we do the same as above except just pull changes from each other's working copy repo? 我们可以像上面那样做,除了从彼此的工作副本回购中拉出变化吗?

That should work fine. 这应该工作正常。

I do something along these lines all the time. 我总是沿着这些方向做点什么。 Here, we've got an svn repository, but several people would rather use git. 在这里,我们有一个svn存储库,但有些人宁愿使用git。 We just had one person create the git respository, and then we all shared that amongst ourselves (rather than everyone creating his own git-svn copy - the original import took over 30 hours). 我们只有一个人创建了git存储库,然后我们都在自己之间共享(而不是每个人创建自己的git-svn副本 - 原始导入花了30多个小时)。 Now anybody who wants to can just work in git and git svn dcommit to push their changes back to the "real" svn repository. 现在任何想要使用git和git svn dcommit可以将他们的更改推送回“真正的”svn存储库。

Think of each user's git repository as a fancy Subversion client, particularly as one with which it's easy to share revisions without involving the central repository. 将每个用户的git存储库视为一个花哨的Subversion客户端,特别是在不涉及中央存储库的情况下很容易共享修订的客户端。 Then everyone should do what seems best and right to them. 然后每个人都应该做对他们最好的事情。

You could also think of the Subversion repository as a fancy git repository. 您还可以将Subversion存储库视为一个精美的git存储库。

Should one git repo be created from svn, then that repo is pushed 'publicly' for team members to clone? 如果从svn创建一个git repo,那么该repo会被“公开”推送给团队成员进行克隆吗? Then would changes be pulled back to the original git repo for rebasing and pushing to svn? 然后将更改被拉回原来的git repo进行变基并推送到svn?

I don't think that's necessary, because git svn clone works mostly the same as git clone to begin with. 我不认为这是必要的,因为git svn clonegit clone工作方式大致相同。

The most important thing to do is to always do git svn rebase before doing git svn dcommit . 最重要的是在执行git svn dcommit之前总是执行git svn rebase If you're doing a lot of revision sharing between git repositories, it is probably a good idea to examine the changes you're going to push to Subversion before doing that git svn dcommit . 如果您在git存储库之间进行了大量的修订共享,那么在执行git svn dcommit之前检查您将要推送到Subversion的更改可能是个好主意。

Git-svn easily supports what you want to do. Git-svn轻松支持您想要做的事情。 I would recommend that each developer creates their own Git repository from the Subversion repository ( git svn clone ). 我建议每个开发人员从Subversion存储库( git svn clone )创建自己的Git存储库。 Developers can pull from each other if they like, including both commits that have already been pushed up to Subversion and ones that have not. 如果他们愿意,开发人员可以互相拉扯,包括已经推送到Subversion的提交和没有提升的提交。

The git-svn equivalent of svn update is git svn rebase , which effectively does a git rebase operation against the Subversion repository. 相当于svn update的git-svn是git svn rebase ,它有效地对Subversion存储库进行git rebase操作。 Any commmits you might have ready to commit, that have already been committed by somebody else, are automatically skipped. 您可能准备提交的任何已经由其他人提交的提交都将被自动跳过。

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

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