
我是懷俄明大學的學生,研究原始碼差異。我一直在從符合以下條件的發行版中複製 git 儲存庫:
sudo cat /var/lib/apt/lists/* | grep Vcs-Git | awk '{print $2}' > ~/apt-sources
我想知道工程師是否可以簡單地鏡像運行東西的 git 伺服器(而不是包鏡像)。我知道大多數軟體包實際上都是 debian 的上游。 。 。但有些事情確實會隨著貢獻而改變。
我將如何鏡像該伺服器?該命令的一些輸出是什麼?
答案1
您不能鏡像伺服器,您可以克隆項目。
使用awk
以下命令進行試運行
find /var/lib/apt/lists/ -type f ! -name "*.gpg" ! -name "lock" -exec awk '/Vcs-Git/ {print "git clone "$2}' {} \; | sort -u
樣本輸出
git clone https://gitlab.uncompleted.org/debian/postfwd.git
git clone https://gitlab.uncompleted.org/debian/ps-watcher.git
git clone https://git.torproject.org/debian/tor.git
git clone http://smarden.org/git/bcron.git/
git clone http://smarden.org/git/dash.git/
git clone http://smarden.org/git/ipsvd.git/
git clone http://smarden.org/git/twoftpd.git/
git clone http://smarden.org/git/ucspi-tcp.git/
git clone https://mod.gnutls.org/mod_gnutls
git clone https://repo.or.cz/r/git/debian.git/
git clone https://www.github.com/ioerror/tlsdate/
git clone http://tcosproject.org/git/p910nd.git
git clone http://tcosproject.org/git/tcosconfig.git
git clone http://tcosproject.org/git/tcos-configurator.git
git clone http://tcosproject.org/git/tcosmonitor.git
git clone http://uv-cdat.llnl.gov/git/cmip5-cmor-tables.git
git clone http://www.project-moonshot.org/git/moonshot.git
git clone http://www.project-moonshot.org/git/moonshot-ui.git
在我的例子中,這個指令用於克隆儲存庫11,818
mkdir -p ~/src
mkdir -p ~/src/mirror
cd ~/src/mirror
find /var/lib/apt/lists/ -type f ! -name "*.gpg" ! -name "lock" -exec awk '/Vcs-Git/ {system("git clone "$2)}' {} \; | sort -u