简体   繁体   English

如何从git获取Chromium指定标签版本的代码?

[英]how to get code of specified tag version of Chromium from git?

i just need code of specified version of Chromium like r69297 which is the latest dev version of Chrome. 我只需要像r69297那样的指定版本的Chromium代码,这是Chrome的最新开发版本。 i use git so i follow the instruction here: http://code.google.com/p/chromium/wiki/UsingGit however, after i sync all the code, and review the commit log, i can't find this revision! 我使用git所以我按照这里的说明: http//code.google.com/p/chromium/wiki/UsingGit但是,在我同步所有代码,并查看提交日志后,我找不到此修订版! then i thought about tag, and searched here. 然后我想到了标签,并在这里搜索。 How to use git to checkout a specified version of Webkit? 如何使用git签出指定版本的Webkit? here i found, but after follow all the steps, and wait for quite a long long time, i still get nothing. 在这里,我发现,但在遵循所有步骤,并等待相当长的时间后,我仍然一无所获。 does the git repository of chromium keep the tag information? 铬的git存储库是否保留标签信息? how can i get them? 我怎么能得到它们? thx 谢谢

When the question was asked, Chromium used SVN. 当问到这个问题时,Chromium使用了SVN。 Nowadays, git is the primary VC system, so I will use git tags/hashes instead of r#### revisions. 如今,git是主要的VC系统,因此我将使用git标签/哈希而不是r #### revisions。

In this answer, I assume that you have already set up the pre-requisites for building Chromium (including an initial checkout). 在这个答案中,我假设您已经设置了构建Chromium的先决条件(包括初始结账)。 If you don't have that one, follow the tutorial at http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html before continuing. 如果您没有,请在继续之前按照http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html上的教程进行操作。 You can skip the gclient sync step because you'll replace the dependencies anyway in the steps below. 您可以跳过gclient sync步骤,因为您将在以下步骤中替换依赖项。

Scenario: I want to apply a patch on top of the latest stable Chromium version. 场景:我想在最新的稳定Chromium版本之上应用补丁。 To find out the latest stable build, just visit https://omahaproxy.appspot.com/ . 要了解最新的稳定版本,请访问https://omahaproxy.appspot.com/ According to that page, the latest version is 38.0.2125.104. 根据该页面,最新版本是38.0.2125.104。 If you want to see previous/next releases, visit http://blink.lc/chromium/refs/ for an overview of tags. 如果您想查看上一个/下一个版本,请访问http://blink.lc/chromium/refs/以获取标签概述。 This list of tags includes unreleased versions, eg 38.0.2125.106 (the last build number increases when new patches are applied on top of the baseline that is identifier by the third number). 此标记列表包括未发布的版本,例如38.0.2125.106(当在基线顶部应用新补丁时,最后一个版本号会增加,该标记由第三个数字标识)。

# Inside chromium/src/
git fetch origin 38.0.2125.106

# Create a new branch "my_stable_branch" that is based on the just-fetched HEAD.
git checkout -b my_stable_branch FETCH_HEAD

# ... apply the patch ...
# (e.g. by editing the files)
# (e.g. by using git cherry-pick [commit id] )
# (e.g. by using git checkout [commit id] [file path] )

# Commit changes (assuming that you want to keep track of your changes)
git commit -va

# Now synchronize the dependencies to the current branch
gclient sync --with_branch_heads  # --jobs 16  if you wish to use parallelism

# Now compile the release build. The output will be stored in src/out/Release.
ninja -C out/Release chrome chrome_sandbox

Branches 分行

If you can't find a particular commit, I'd check if it's in a branch other than "master". 如果你找不到特定的提交,我会检查它是否在“master”以外的分支中。 When you first clone a repository, you only get the "master" branch. 首次克隆存储库时,只能获得“主”分支。 You can run the following to checkout a branch available on the remote Chromium repository: 您可以运行以下命令来检出远程Chromium存储库上可用的分支:

git branch new-local-branch origin/some-remote-branch
git checkout new-local-branch

Obviously use the correct name for the remote branch and name your local branch something logical. 显然,使用远程分支的正确名称,并将本地分支命名为逻辑。

Tags 标签

When you clone a Git repo, you should get all of its tags by default. 当你克隆一个Git仓库时,你应该默认获得它的所有标签。 You can get a list of all defined tags by running git tag or git tag -l . 您可以通过运行git taggit tag -l获取所有已定义标记的列表。

If you don't see any tags, try fetching them explicitly: 如果您没有看到任何标记,请尝试显式获取它们:

git fetch --tags

Once you have the tag you want, check it out to start using that version of the code base: 获得所需的标记后,请检查它以开始使用该版本的代码库:

git checkout <name of tag>

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

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