Creating an Android Mirror
1. Prerequisites/Assumptions
install repo git
2.Setting up a Git Server
a.sudo apt-get install git-daemon
b.change iptables, git-daemon use tcp port 9481
sudo /sbin/iptables -A INPUT -p tcp -m tcp --dport 9481 -j ACCEPT
c.config /etc/sv/git-daemon/run, to export git trees in "/opt/coderepo"
====================================================
#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec git-daemon --verbose --export-all --base-path=/opt/coderepo /opt/coderepo
====================================================
restart git-daemon: sudo /etc/init.d/git-daemon retart
d.git-dameon log file: /var/log/git-daemon/current
3. Using Git Behind a Firewall
install corkscrew
create a new file called "git-proxy.sh" with following contents and replace
and
==================================================
#!/bin/sh
exec /usr/bin/corkscew $*
==================================================
chmod a+x git-proxy.sh
git config --global core.gitproxy '/git-proxy.sh'
to configure git to only use the proxy for specific URLs
git config --global core.gitproxy '"/git-proxy.sh" for kernel.org' 'for kernel.org$'
4. Create the mirror.
mkdir /opt/coderepo/myandroid
cd /opt/coderepo/myandroid
repo init -u git://android.git.kernel.org/platform/manifest.git --mirror
repo sync
5.change manifest.git config, if not , can not push code change
cd /opt/coderepo/myandroid/platform/manifest.git
edit config file, add following lines
[daemon]
uploadpack=true
uploadarch=true
receivepack=true
6. change manifest.git
a.clone manifest.git
cd ~
git clone git://android.git.kernel.org/platform/manifest.git
b.Edit the file "~/manifest.git/default.xml"
- fetch="git://android.git.kernel.org/"
+ fetch="git:///myandroid/"
review="review.source.android.com" />
remote="korg" />
c. commit and push this change.
git commit -a
git push git:///myandroid/platform/manifest.git
7. The setup of the mirror is now complete. make a test
cd ~
mkdir testmirror
repo init -u git:///myandroid/platform/manifest.git
repo sync
8.References
/using-repo
阅读(2454) | 评论(0) | 转发(0) |