git 如何下载 Chromium 源代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22357693/
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-19 09:50:25  来源:igfitidea点击:

How to download Chromium source code?

gitchromium

提问by Colonel Panic

I'd like to download some Chromium source code. In particular, the folder described at https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/email_this_page/

我想下载一些 Chromium 源代码。特别是在https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/extensions/email_this_page/ 中描述的文件夹

How can I do that?

我怎样才能做到这一点?

I can't see the clone URL. I'm not even sure whether it's a git repo.

我看不到克隆 URL。我什至不确定它是否是 git repo。

采纳答案by Speedoops

As of today, you can get it from GitHub:

截至今天,您可以从 GitHub 获取它:

The official GitHub mirror of the Chromium source: https://github.com/chromium/chromium

Chromium源码官方GitHub镜像https: //github.com/chromium/chromium

回答by Colonel Panic

Per https://chromium.googlesource.com/chromium/src

根据https://chromium.googlesource.com/chromium/src

git clone https://chromium.googlesource.com/chromium/src

Easy peasy lemon squeezy

简单的豌豆柠檬汁

回答by Mike Samuel

Cloning with git cloneis a tad slow. See bolded text below.

克隆git clone有点慢。请参阅下面的粗体文本。

https://chromium.googlesource.com/chromium/src/+/lkcr/docs/linux_build_instructions.md#get-the-code

https://chromium.googlesource.com/chromium/src/+/lkcr/docs/linux_build_instructions.md#get-the-code

Create a chromium directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces):

$ mkdir ~/chromium && cd ~/chromium

Run the fetch tool from depot_tools to check out the code and its dependencies.

$ fetch --nohooks chromium

If you don't want the full repo history, you can save a lot of time by adding the --no-historyflag to fetch.

Expect the command to take 30 minutes on even a fast connection, and many hours on slower ones.

为结帐创建一个chromium目录并更改为它(你可以随意调用它并把它放在你喜欢的任何地方,只要完整路径没有空格):

$ mkdir ~/chromium && cd ~/chromium

从 depot_tools 运行 fetch 工具以检查代码及其依赖项。

$ fetch --nohooks chromium

如果你不想要完整的 repo 历史,你可以通过添加--no-history标志来节省大量时间来获取。

预计该命令即使在快速连接上也需要30 分钟,而在较慢的连接上则需要数小时

回答by guneysus

Remove the /viewvcfrom url and clone (checkout)with svn checkout <url-without-viewvc>

删除/viewvc从URL和克隆(结账)svn checkout <url-without-viewvc>

Not this:svn checkout http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/

不是这个:svn checkout http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/

But this:svn checkout http://src.chromium.org/chrome/trunk/src/chrome/common/extensions/docs/

但是这个:svn checkout http://src.chromium.org/chrome/trunk/src/chrome/common/extensions/docs/