git-svn 和一个大项目
我在网上搜索了很多关于使用 git-svn 和分支的信息,但没有任何适合我的情况。
我正在开展一个大型项目,整个星期我都会在多个分支机构中的几个项目上工作。处理 git 分支的标准方法在这里对我不起作用......只是因为所涉及的代码的大小。从头开始编译大约需要一个小时,所以我不能以这种方式在分支之间来回切换。我想使用 git-svn 这样我就可以使用本地分支。 svn 分支也可以被视为单独的项目,在某些地方具有公共代码。
我想要做的就是使用 git-svn 将一个 svn 存储库的更改合并到另一个 svn 存储库,但我还没有找到一种方法可以从 google 或 git-svn 文档中做到这一点。我在 svn 中处理这个问题,方法是为每个分支维护一个单独的 svn checkout 它自己的目录,然后使用合并命令来提取更改。我期望能够使用 git-svn 做类似的事情,但我还没有找到从另一个 svn 分支提取更改的方法。有办法做到这一点吗?
I've scoured the web and found a lot about working with git-svn and branches, but nothing that fits my situation.
I'm working on a large project, and I work on several of many branches throughout the week. Standard ways of handling git branching wouldn't work for me here... just because of the size of the code involved. It takes about an hour to compile from the ground up, so I can't be switching back and forth between branches in that way. I want to use git-svn so I can use local branches. The svn branches might as well be considered separate projects, with common code in certain places.
All I want to be able to do is merge changes from one svn repo to another using git-svn, but I haven't found a way to do it from google or the git-svn docs. I handle this in svn by maintaining a separate svn checkout it its own directory for each branch, and just use the merge command to pull changes. I expected to be able to do something similar using git-svn, but I haven't found the way to pull changes from another svn branch. Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用类似于 Mercurial 的方法:每个存储库一个分支。
每个 SVN 分支都将通过 git-svn 驻留在 git 存储库中(专门用于仅导入/导出一个分支)。
在 Git 存储库之间,您可以在 git-svn dcommit 之前跟踪另一个 git 存储库(又名另一个 SVN 分支)的分支,将其提取到给定的 git 存储库(另一个 SVN 分支)并将其合并到当前的主分支 该分支返回到相关的 svn 分支。
You could use an approach similar to Mercurial: one branch per repository.
Each SVN branch would live in a git Repository through a git-svn (tailored to import/export only one branch).
Between the Git repositories, you could then track the branch of another git repo (aka, another SVNbranch), fetch it into a given git repo (another SVNbranch) and merge it to your current master branch, before
git-svn dcommit
that branch back to the relevant svn branch.您可以拥有 git-svn 存储库的本地共享克隆。但是,您必须分别更新两者。更好的方法是使用 git-new-workdir,它将创建为您提供一个新的工作目录,具有单独的索引,但共享存储库。因此,如果您在原始存储库中更新/获取新提交,那么它们也将在其他工作目录中变得可见。因此,您可以为每个分支使用单独的工作目录。
You could have a local shared clone of your git-svn repo. But then, you would have to update both separately. A better approach would be to use git-new-workdir, which will create a new working dir for you, with a separate index, but shared repo. So, if you update/fetch new commits in the original repo, then they'll become visible in the other working dir also. So, you can use separate working dirs, for each of your branches.