pythongitdulwich

How to pull from the remote using dulwich?


How to do something like git pull in python dulwich library.


Solution

  • I haven't used dulwich, but from these doc's, possibly something like:

    from dulwich.repo import Repo
    from dulwich.client import HttpGitClient
    local = Repo.init("local", mkdir=True)
    client = HttpGitClient('http://github.com/adammorris/')
    remote_refs = client.fetch("history.js.git",local)
    local["HEAD"] = remote_refs["refs/heads/master"]
    

    At this point, it didn't load the files, but I could do "git checkout" from the local path, and it updated the files.

    Also, saw these: