使用 git 从谷歌代码克隆一个颠覆项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19477327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 17:09:50  来源:igfitidea点击:

Cloning a subversion project from google code using git

gitsvnversion-controlgoogle-code

提问by Paul Wagland

There is someone's project at google code which I want to clone using git. However, nothing of these worked:

我想使用 git 克隆 google code 上的某人的项目。然而,这些都没有奏效:

git clone http://some_app.googlecode.com

git clone http://some_app.googlecode.com/svn

git clone http://some_app.googlecode.com/svn/trunk

git svn -s clone http://some_app.googlecode.com/svn/trunk

How do I do it?

我该怎么做?

回答by Paul Wagland

Since, based on the URL, it looks like you are trying to access a subversion repository, you cannot use git in a simple way to get to it.

由于根据 URL,您似乎正在尝试访问一个 subversion 存储库,因此您无法以简单的方式使用 git 来访问它。

Theoretically you could use git-svn, which you looked at in your last example, however if you don't know about it already you probably want to learn more about git and svn first.

从理论上讲,您可以使用git-svn,您在上一个示例中看过它,但是如果您还不了解它,您可能想先了解有关 git 和 svn 的更多信息。

To check the code out of an svn repository you need to use svn, as in:

要从 svn 存储库中检出代码,您需要使用svn,如下所示:

svn co http://some_app.googlecode.com/svn/trunk

If you really want to use git to access the subversion repository via git, then you need to initthe repository first. The workflow looks something like:

如果你真的想用git通过git访问subversion仓库,那么你需要init先到repository。工作流程如下所示:

git svn clone -s http://some_app.googlecode.com/svn/

The -sswitch says to use the standard layout, and so will append trunkto it.

-s开关表示使用标准布局,因此将追加trunk到它。