SVN:外部在Git中相当于? [英] SVN:externals equivalent in Git?

查看:111
本文介绍了SVN:外部在Git中相当于?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从另一个SVN仓库使用两个SVN项目,使用 svn:externals



如何在Git中拥有相同的存储库布局结构?

解决方案

< Git有两种类似的方法,但不完全等同于svn:externals:


$ b

I have two SVN projects in use from another SVN repository using svn:externals.

How can I have the same repository layout structure in Git?

解决方案

Git has two approaches similar to, but not exactly equivalent to svn:externals:

  • Subtree merges insert the external project's code into a separate sub-directory within your repo. This has a detailed process to set up and then is very easy for other users, because it is automatically included when the repository is checked out or cloned. This can be a convenient way to include a dependency in your project.
    It is easy to pull changes from the other project, but complicated to submit changes back. And if the other project have to merge from your code, the project histories get merged and the two projects effectively become one.

  • Git submodules (manual) link to a particular commit in another project's repository, much like svn:externals with an -r argument. Submodules are easy to set up, but all users have to manage the submodules, which are not automatically included in checkouts (or clones).
    Although it is easy to submit changes back to the other project, doing so may cause problems if the repo has changed. Therefore it is generally not appropriate to submit changes back to a project that is under active development.

这篇关于SVN:外部在Git中相当于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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