Step by step

.一一 . .一.. 一.一. 一一一 一一 . 一 一一一 一一 一.一一 .一一 一一一 .一. .一.. 一.....

Repo建立本地仓库脚本

Repo脚本

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo  
$ chmod a+x ~/bin/repo
这边应该还要将repo加到/usr/bin/下面

创建本地库的脚本

这边使用的我自己修改的过的repo,方便不能翻墙的朋友测试,不过用官方的repo也是可以的,需要手动修改下面一句代码。
附件地址
下载附件解包后,里面的clone.bundle,repo,sh脚本都要在同一级目录,不然会自动联网下载。

#!/bin/sh
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
curDir=`pwd`
mkdir reposerver
cd reposerver
serverDir=`pwd`
git init --bare manifest.git
git init --bare app1.git
git init --bare app2.git
cd ../
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git clone reposerver/manifest.git
cd manifest
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<manifest>
    <remote name=\"reposerver\"  fetch=\"$serverDir\" review=\"review.source.android.com\" />
    <default revision=\"master\" remote=\"reposerver\" />
    <project path=\"app1\" name=\"app1\" />
    <project path=\"app2\" name=\"app2\" />
</manifest>" > default.xml
git add default.xml
git commit -am "add default.xml"
git push origin master:master
cd ..
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git clone reposerver/app1.git
cd app1
echo "Hello world!" > hw1
git add hw1
git commit -am "add file"
git push origin master:master
cd ..
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git clone reposerver/app2.git
cd app2
echo "Hello world!" > hw2
git add hw2
git commit -am "add file"
git push origin master:master
cd ..
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mkdir repoclient
cd repoclient
cp ../clone.bundle ./
cp ../repo ./
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++use local repo
python ./repo init -u $curDir/reposerver/manifest.git
#repo init -u $curDir/reposerver/manifest.git
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
repo sync
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
repo info
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shmcclmm/article/details/46839597
个人分类: linux android
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Repo建立本地仓库脚本

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭