2010-12-19 86 views
6

我只需要Chrome的指定版本的代码,如r69297,它是Chrome的最新开发版本。 我使用git,所以我按照这里的说明: http://code.google.com/p/chromium/wiki/UsingGit 但是,我同步所有的代码,并检查提交日志后,我找不到此修订! 然后我想到了标签,并在这里搜索。 How to use git to checkout a specified version of Webkit? 在这里我发现了,但在按照所有步骤,并等待相当长的时间后,我仍然没有得到任何东西。 铬的git仓库是否保留标签信息?我怎么能得到他们? THX如何从git获取指定标签版本的Chromium代码?

+0

你是什么意思,“我还是什么都没有”?你能展示运行这些命令的结果吗? – 2010-12-19 10:53:14

+0

@Jean Hominal:没有输出。在git树中不存在版本69297,只有r69298。 – ayanamist 2010-12-19 14:47:35

+0

尝试使用gitk查看Git存储库的历史记录 - 您可以通过其散列引用精确提交 – 2010-12-19 15:40:34

回答

12

当有人问,铬使用SVN。现在,git是主要的VC系统,所以我将使用git标签/散列而不是r ####修订版。

在这个答案中,我假设您已经设置了构建Chromium的前提条件(包括初始结账)。如果你没有那个,请继续阅读教程http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html。您可以跳过步骤gclient sync,因为您将在下面的步骤中替换依赖项。

场景:我想在最新的稳定Chromium版本上应用补丁。要了解最新的稳定版本,请访问https://omahaproxy.appspot.com/。根据该页面,最新版本是38.0.2125.104。如果您想查看上一个/下一个版本,请访问http://blink.lc/chromium/refs/了解标签概述。这个标签列表包括未发布的版本,例如, 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 
1

分行

如果你不能找到一个特定的承诺,我会检查它是否比“大师”以外的分支。当你第一次克隆版本库时,你只能得到“主”分支。您可以运行下面的检出一个分支可在远程铬库:

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

显然使用了正确的名称为远程分支并命名当地分行的东西逻辑。

标签

当你克隆一个Git回购,你应该在默认情况下得到的所有的标签。您可以通过运行git taggit tag -l来获取所有已定义标签的列表。

如果你没有看到任何标记,可以明确地获取他们:

git fetch --tags

一旦你有你想要的标签,检查它开始使用该版本的代码库:

git checkout <name of tag>

相关问题