代理方式下载aosp、github代码方法

如果因为代理方式下载aosp代码出现异常,可以用如下方法解决,备忘

1)新建一个ropo

curl http://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo_aosp

chmod a+x ~/bin/repo_aosp

2)https->http

export REPO_URL='http://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

repo_aosp init -u http://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-11.0.0_r35

3) 

export http_proxy=http://xxx.com:8080
export https_proxy=https://xxx.com:8080
repo init -u http://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-12.0.0_r10 --no-repo-verify --repo-branch=stable --repo-url=http://mirrors.tuna.tsinghua.edu.cn/git/git-repo
上述3条命令在()亲测成功,注意去掉repo init中的所有https,改成http

4)github代码下载方法

git clone http://github.com/coolsnowwolf/lede --config "http.proxy=http://xxx:xxx@proxy.xxxx.com:8080"

    
设置代理方式:git config --global http.proxy xxx:xxxxxx@http://proxy.xxx.com:8080
取消代理方式:git config --global --unset http.proxy

全局代理
export http_proxy="xxxxx" 

vim ~/.bashrc
http_proxy=http://yourproxyaddress:proxyport

wget代理方式(curl怎么加代理还没搞明白)
vi ~/.wgetrc
http_proxy = http://proxy.xxx.com:8080
https_proxy = https://proxy.xxx.com:8080
proxy_user = username
proxy_password = password
use_proxy = on
wait = 15

下载github代码编译方法:
1. git clone改为http
2. feeds.conf.default中feed源改为http
3. vi ~/.wgetrc,增加wget代理,这个是支持https的
4. 愉快的编译

repo init 常见错误解决方案

错误1
SyntaxError: invalid syntax
解决方案:
curl http://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod +x ~/bin/repo
PATH="${HOME}/bin:${PATH}"

错误2
error.GitError: manifests rev-list ('^ca277d1d6b8d2f1f64dd8423401df0382f554d12', 'HEAD', '--'): fatal: bad revision 'HEAD'
解决方案:rm -rf .repo/manifest*

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值