Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望能够获得一个 URL,比如https://github.com/user/repo.git给定一个远程名称,例如origin. 到目前为止,我只设法获得了提交哈希:
https://github.com/user/repo.git
origin
>>> from dulwich import porcelain >>> hash = porcelain.ls_remote('.')[b'refs/remotes/origin/master']
目前,还没有瓷器包装。使用管道,您可以使用:
>>> from dulwich.repo import Repo >>> config = Repo('.').get_config() >>> config.get(('remote', 'origin'), 'url') b'git://jelmer.uk/dulwich'