{"id":1085,"date":"2020-09-19T11:59:22","date_gmt":"2020-09-19T03:59:22","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=1085"},"modified":"2020-09-19T11:59:22","modified_gmt":"2020-09-19T03:59:22","slug":"%e4%bd%bf%e7%94%a8gitbash%e5%90%8c%e6%ad%a5android-aosp%e6%ba%90%e7%a0%81%e4%bb%a5%e5%8f%8a%e4%bd%bf%e7%94%a8%e5%9b%bd%e5%86%85%e9%95%9c%e5%83%8f%e6%9d%a5%e5%81%9a%e6%9c%ac%e5%9c%b0aosp%e9%95%9c","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=1085","title":{"rendered":"\u4f7f\u7528GitBash\u540c\u6b65android AOSP\u6e90\u7801\u4ee5\u53ca\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6765\u505a\u672c\u5730AOSP\u955c\u50cf"},"content":{"rendered":"<h2>\u901a\u8fc7\u56fd\u5185Android AOSP\u955c\u50cf\u6765\u505a\u672c\u5730\u955c\u50cf\uff1a<\/h2>\n<div><strong>\u53c2\u8003\uff08\u56fd\u5185\u6e05\u534e\u548c\u4e2d\u79d1\u5927\u4e24\u4e2a\u955c\u50cf\u7ad9\u70b9\u7684\u5730\u5740\uff09\uff1a<\/strong><\/div>\n<div><a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/help\/AOSP\/\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/help\/AOSP\/<\/a><\/div>\n<div><a href=\"https:\/\/lug.ustc.edu.cn\/wiki\/mirrors\/help\/aosp\/\">https:\/\/lug.ustc.edu.cn\/wiki\/mirrors\/help\/aosp\/<\/a><\/div>\n<div><\/div>\n<div><\/div>\n<h4>\u5148\u5b89\u88c5git\u3002<\/h4>\n<div>\u914d\u7f6e\u7f13\u5b58\u5927\u5c0f\u4e3a1GB-1\uff1a<\/div>\n<div># git config &#8211;global https.postBuffer\u00a01073741823<\/div>\n<div># git config &#8211;global http.postBuffer\u00a01073741823<\/div>\n<div># git config &#8211;global git.postBuffer\u00a01073741823<\/div>\n<div>\u914d\u7f6egit\u7528\u6237\u4fe1\u606f\uff1a<\/div>\n<div># git config &#8211;global user.name &#8220;Max Shu&#8221;<\/div>\n<div># git config &#8211;global user.email &#8220;maxshu_cn@163.com&#8221;<\/div>\n<div><\/div>\n<h4>\u5b89\u88c5repo\uff1a<\/h4>\n<div># curl <a href=\"https:\/\/storage.googleapis.com\/git-repo-downloads\/repo\">https:\/\/storage.googleapis.com\/git-repo-downloads\/repo<\/a> &gt;\u00a0~\/repo<\/div>\n<div># sudo mv ~\/repo \/bin\/repo<\/div>\n<div># sudo chmod a+x \/bin\/repo<\/div>\n<div><\/div>\n<h4>\u955c\u50cf\u5e76\u540c\u6b65\uff1a<\/h4>\n<div># mkdir \/AOSP_mirror<\/div>\n<div># cd \/AOSP_mirror<\/div>\n<div># repo init -u <a href=\"git:\/\/mirrors.ustc.edu.cn\/aosp\/platform\/manifest\">git:\/\/mirrors.ustc.edu.cn\/aosp\/platform\/manifest<\/a> &#8211;mirror &#8211;repo-url=<a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/git-repo\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/git-repo<\/a><\/div>\n<div>\u6216\u8005\uff1a# repo init -u <a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/AOSP\/mirror\/manifest\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/aosp\/mirror\/manifest<\/a> &#8211;mirror<\/div>\n<div># repo sync<\/div>\n<div>\u6267\u884c\u591a\u6b21\uff0c\u4e00\u76f4\u5230\u540c\u6b65\u5b8c\u6210\uff08\u4ee5\u540e\u9700\u8981\u5b9a\u671f\u540c\u6b65\uff09\u3002<\/div>\n<div><\/div>\n<div><strong>\u67e5\u770b\u4e00\u4e0b\u4ece\u54ea\u91cc\u955c\u50cf\u8fc7\u6765\u7684\uff1a<\/strong><\/div>\n<div># vi .repo\/manifests.git\/config<\/div>\n<div>[remote &#8220;origin&#8221;]<\/div>\n<div>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0url = git:\/\/mirrors.ustc.edu.cn\/aosp\/platform\/manifest<\/div>\n<div>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/div>\n<div><\/div>\n<h4>\u505a\u672c\u5730git:\/\/\u955c\u50cf\uff1a<\/h4>\n<div># yum install git-daemon<\/div>\n<div># git daemon &#8211;verbose &#8211;export-all &#8211;base-path=\/AOSP_mirror<\/div>\n<div>\u6d4b\u8bd5\u4e0b\uff1a<\/div>\n<div>\uff08\u5230\u522b\u7684\u76ee\u5f55\u6216\u673a\u5668\u6267\u884c\u514b\u9686\uff09$ git clone git:\/\/172.18.1.23\/device\/google\/bonito-kernel<\/div>\n<div>\u542f\u52a8\u5230\u540e\u53f0\uff08\u9ed8\u8ba4\u7aef\u53e3\u4e3a9418\uff09\uff1a<\/div>\n<div># git daemon &#8211;verbose &#8211;export-all &#8211;base-path=\/AOSP_mirror\u00a0\u00a0&#8211;detach<\/div>\n<div><\/div>\n<h4>\u5230\u5176\u4ed6\u673a\u5668\u4e0a\u6d4b\u8bd5\uff1a<\/h4>\n<div>$ repo init -u <a href=\"git:\/\/172.18.1.23\/platform\/manifest\">git:\/\/172.18.1.23\/platform\/manifest<\/a>\u00a0&#8211;repo-url=<a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/git-repo\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/git-repo<\/a><\/div>\n<div>$ repo sync<\/div>\n<div><\/div>\n<h4>\u66ff\u6362\u5df2\u6709\u4ee3\u7801\u91cc\u9762\u7684https:\/\/\u955c\u50cf\u4e3agit\u65b9\u5f0f\uff1a<\/h4>\n<div>$ vi .repo\/manifests.git\/config<\/div>\n<div>[remote &#8220;origin&#8221;]<\/div>\n<div>#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0url = http:\/\/aosp.tuna.tsinghua.edu.cn\/platform\/manifest<\/div>\n<div>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0url = <a href=\"git:\/\/172.18.1.23\/platform\/manifest\">git:\/\/172.18.1.23\/platform\/manifest<\/a><\/div>\n<div>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/div>\n<div><strong>\u6216\u8005\uff1a<\/strong><\/div>\n<div>$ git config &#8211;global url.git:\/\/172.18.1.23\/.insteadof\u00a0 \u00a0 https:\/\/android.googlesource.com<\/div>\n<div>$ git config &#8211;global url.git:\/\/172.18.1.23\/.insteadof\u00a0 \u00a0 http:\/\/android.googlesource.com<\/div>\n<div><\/div>\n<div><strong>\u5c11\u91cf\u7684\u5219\u53ef\u4ee5\u4fee\u6539android AOSP\u7684url\u4e3a\u56fd\u5185\u955c\u50cf\u7684\u6765\u4e0b\u8f7d\u4e5f\u53ef\u4ee5\uff1a<\/strong><\/div>\n<div>$ git config &#8211;global url.https:\/\/mirrors.tuna.tsinghua.edu.cn\/git\/AOSP\/.insteadof\u00a0 \u00a0 https:\/\/android.googlesource.com<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<h2>\u4f7f\u7528GitBash\u540c\u6b65Adnroid\u7684AOSP\u6e90\u7801\uff1a<\/h2>\n<div>\u5fc5\u987b\u4f7f\u7528<span style=\"color: #ff0000;\"><strong>\u7cfb\u7edf\u7ba1\u7406\u5458\u65b9\u5f0f<\/strong><\/span>\u6253\u5f00GitBash\u3002<\/div>\n<h4>\u8bbe\u7f6e\u4ee3\u7406\uff0c\u4ee5\u4fbf\u80fd\u8bbf\u95eeadnroid aosp\u7f51\u7ad9\uff1a<\/h4>\n<div>$ export http_proxy=&#8221;127.0.0.1:1080&#8243;<\/div>\n<div>$ export https_proxy=&#8221;127.0.0.1:1080&#8243;<\/div>\n<h4>\u5b89\u88c5repo\uff1a<\/h4>\n<div>$ mkdir aosp<\/div>\n<div>$ cd aosp<\/div>\n<div>$ wget\u00a0<a href=\"https:\/\/storage.googleapis.com\/git-repo-downloads\/repo\">https:\/\/storage.googleapis.com\/git-repo-downloads\/repo<\/a><\/div>\n<div>$ chmod a+x .\/repo<\/div>\n<h4>\u914d\u7f6e\u7f13\u5b58\u5927\u5c0f\uff1a<\/h4>\n<div>$ git config &#8211;global https.postBuffer 2147483648<\/div>\n<div>$ git config &#8211;global http.postBuffer 2147483648<\/div>\n<h4>\u521d\u59cb\u5316\u662f\u5426\u80fd\u884c\uff1a<\/h4>\n<div>$ .\/repo init -u <a href=\"https:\/\/android.googlesource.com\/platform\/manifest\">https:\/\/android.googlesource.com\/platform\/manifest<\/a><\/div>\n<div>\u5982\u679cpgp\u6821\u9a8c\u51fa\u9519(gpg: keyblock resource &#8216;\/e\/Work\/AOSP_mirror\/.repo\/repo\/C:\\Users\\maxsh\/.repoconfig\\gnupg\/pubring.kbx&#8217;: No such file or directory)\uff1a<\/div>\n<div>$ cd .repo\/<\/div>\n<div>$ git clone <a href=\"https:\/\/gerrit.googlesource.com\/git-repo\">https:\/\/gerrit.googlesource.com\/git-repo<\/a><\/div>\n<div>$ rm -rf repo\/<\/div>\n<div>$ mv git-repo repo<\/div>\n<div>$ cd ..<\/div>\n<h4>\u91cd\u65b0\u521d\u59cb\u5316\uff1a<\/h4>\n<div>$ .\/repo init -u <a href=\"https:\/\/android.googlesource.com\/platform\/manifest\">https:\/\/android.googlesource.com\/platform\/manifest<\/a><\/div>\n<h4>\u540c\u6b65\uff1a<\/h4>\n<div>$ .\/repo sync<\/div>\n<div>\u53ef\u80fd\u6267\u884c\u591a\u6b21\uff0c\u4e00\u76f4\u5230\u540c\u6b65\u5b8c\u6210\u3002<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7\u56fd\u5185Android AOSP\u955c\u50cf\u6765\u505a\u672c\u5730\u955c\u50cf\uff1a \u53c2\u8003\uff08\u56fd\u5185\u6e05\u534e\u548c\u4e2d\u79d1\u5927\u4e24\u4e2a\u955c\u50cf\u7ad9\u70b9\u7684\u5730\u5740\uff09\uff1a https: &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,13],"tags":[815,310,818,817,816],"class_list":["post-1085","post","type-post","status-publish","format-standard","hentry","category-linuxandroid","category-13","tag-aosp","tag-git","tag-repo","tag-817","tag-816"],"views":3064,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1085"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1085\/revisions"}],"predecessor-version":[{"id":1086,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1085\/revisions\/1086"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1085"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}