Created
May 9, 2013 15:16
-
-
Save aaroncox/5548105 to your computer and use it in GitHub Desktop.
Cloning a Repo from Github using Dulwich/Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import dulwich.client | |
from dulwich.repo import Repo | |
from dulwich import index | |
import os | |
import shutil | |
client, path = dulwich.client.get_transport_and_path("https://github.com/aaroncox/d3.git") | |
src = "https://github.com/aaroncox/d3.git" | |
target = "local" | |
shutil.rmtree(target) | |
os.mkdir(target) | |
r = Repo.init(target) | |
remote_refs = client.fetch(src, r) | |
r["HEAD"] = remote_refs["HEAD"] | |
index.build_index_from_tree(r.path, r.index_path(), r.object_store, r['head'].tree) |
QGB
commented
Jan 28, 2020
index.build_index_from_tree('C:\qgb\test','C:\qgb\test\.git\index',<DiskObjectStore('C:\qgb\test\.git\objects')>,b'8b65f1fe548bc15681ad6109b7824cb1c2c0444e',)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment