git mirror的创建与使用

上官淮晨
2023-12-01
please donwload repo mirro as follow steps, thanks


1.mirror server,server IP:192.168.0.123

1.1

-- delete the old version repo bin file;
-- $sudo apt-get install semc-gitwizard
-- open a new terminal(make repo bin file available);
-- download repo mirror as follow,
$mkdir ~/my_mirror
$cd ~/my_mirror

$repo init -u git://XXXX/manifest.git -b xxxx --mirror

$repo sync

1.2 share your mirror

在/etc/exports加句

/home/your_username/my_mirror     *(ro,async,no_root_squash,nohide)

运行
$ sudo exportfs -rv

/*上面括号ro读rw读写权限*/


2.--work with mirror

2.1. Local

$mkdir ~/my_repos
$mkdir ~/my_repos/<branch_name>
$cd ~/my_repos/<branch_name>

$repo init -u git://XXXX/manifest.git -b xxxx --reference=/home/<path>/my_mirror


2.2.other PC (client):

$cd mnt

$sudo mkdir nfs

$sudo mount 192.168.0.123:/home/mirror_path/my_mirror  /mnt/nfs

$mkdir ~/my_repos
$mkdir ~/my_repos/<branch_name>
$cd ~/my_repos/<branch_name>

$repo init -u git://XXXX/manifest.git -b xxxx --reference=/mnt/nfs

$ repo sync

转载于:https://www.cnblogs.com/yangykaifa/p/6825337.html

 类似资料: