如何使用 Git 从 android.googlesourcecode.com 下载特定版本的源代码?

Mor*_*rya 5 download git-clone android-source

我想从 下载标签中显示的源代码android.googlesourcecode。比如我要下载日历代码

https://android.googlesource.com/platform/packages/apps/Calendar

我也想下载android特定版本标签的代码。例如,android-4.0.3_r1.1从以下链接

https://android.googlesource.com/platform/packages/apps/Calendar/+/android-4.0.3_r1.1

当我从 git 存储库浏览此代码时,它不会显示标签的代码版本。我该怎么做呢?

Von*_*onC 2

所有标签都列在“日历”页面的“所有标签”下。该页面包含android-4.0.3_r1.1.

如果您克隆存储库并查找该标签,您也会找到它。例如:

C:\prog\git>git clone https://android.googlesource.com/platform/packages/apps/Calendar
Cloning into 'Calendar'...
remote: Counting objects: 80, done
remote: Finding sources: 100% (80/80)
remote: Total 30504 (delta 15730), reused 30504 (delta 15730)
Receiving objects: 100% (30504/30504), 11.16 MiB | 4.61 MiB/s, done.
Resolving deltas: 100% (15730/15730), done.

C:\prog\git>cd Calendar

C:\prog\git\Calendar>git tag|grep 4.0.3
android-4.0.3_r1
android-4.0.3_r1.1
...
Run Code Online (Sandbox Code Playgroud)

git checkout android-4.0.3_r1.1从那里,您可以简单地浏览该特定标签的来源。