
Uno strumento per scaricare un repository git da un sito web.
Uno strumento per scaricare un repository git da un sito web.
Può essere installato facilmente con 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
-b BRANCH, --branch BRANCH
additional branch name to check for (repeatable)
git-dumper http://website.com/.git ~/website
Usa questo software a tuo rischio e pericolo!
Dovresti sapere che se il repository che stai scaricando è controllato da un attaccante, ciò potrebbe portare all'esecuzione di codice remoto sulla tua macchina.
Basta installare le dipendenze con pip:
pip install -r requirements.txt
Quindi, usa semplicemente:
./git_dumper.py http://website.com/.git ~/website
Lo strumento prima verificherà se il directory listing è disponibile. Se lo è, scaricherà ricorsivamente la directory .git (quello che faresti con wget).
Se il directory listing non è disponibile, userà diversi metodi per trovare quanti più file possibile. Passo dopo passo, git-dumper:
.gitignore, .git/HEAD, .git/index, ecc.);refs/heads/master, refs/remotes/origin/HEAD, ecc.) analizzando .git/HEAD, .git/logs/HEAD, .git/config, .git/packed-refs e così via;.git/packed-refs, .git/index, .git/refs/* e .git/logs/*;git checkout . per recuperare l'albero di lavoro corrente.