git dumper
Release 1.0.8
一種從網站傾倒GIT存儲庫的工具。
可以通過PIP輕鬆安裝:
pip install git-dumper
usage: git-dumper [options] URL DIR
Dump a git repository from a website.
positional arguments:
URL url
DIR output directory
optional arguments:
-h, --help show this help message and exit
--proxy PROXY use the specified proxy
-j JOBS, --jobs JOBS number of simultaneous requests
-r RETRY, --retry RETRY
number of request attempts before giving up
-t TIMEOUT, --timeout TIMEOUT
maximum time in seconds before giving up
-u USER_AGENT, --user-agent USER_AGENT
user-agent to use for requests
-H HEADER, --header HEADER
additional http headers, e.g `NAME=VALUE`
--client-cert-p12 CLIENT_CERT_P12
client certificate in PKCS#12 format
--client-cert-p12-password CLIENT_CERT_P12_PASSWORD
password for the client certificate
git-dumper http://website.com/.git ~/website
使用此軟件自行風險!
您應該知道,如果要下載的存儲庫由攻擊者控制,這可能會導致計算機上的遠程代碼執行。
只需使用PIP安裝依賴項:
pip install -r requirements.txt
然後,只需使用:
./git_dumper.py http://website.com/.git ~/website
該工具將首先檢查目錄清單是否可用。如果是這樣,那麼它將僅遞歸下載.git目錄(您將使用wget )。
如果目錄列表不可用,它將使用幾種方法來查找盡可能多的文件。一步一步,git-dumper將:
.gitignore , .git/HEAD , .git/index等);.git/HEAD , .git/logs/HEAD , .git/packed-refs等,以查找盡可能多的參考(例如refs/heads/master , refs/remotes/origin/HEAD .git/config promots/orient/head等);.git/packed-refs , .git/index , .git/refs/* and .git/logs/*來查找盡可能多的對象(SHA1)。git checkout .恢復當前的工作樹