git dumper
Release 1.0.8
Webサイトから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/config 、 .git/packed-refsなどを分析することにより、できるだけ多くのref(参照refs/heads/master 、 refs/remotes/origin/HEADなど)を見つけます。.git/packed-refs 、 .git/index 、 .git/refs/*および.git/logs/*を分析することにより、できるだけ多くのオブジェクト(SHA1)を見つけます。git checkout .現在の作業ツリーを回復するため