実行したい
git remote add -f origin <repo>
ダルウィッチ付き。しかし、私はこの方向に何かを見つけることができませんでした。
誰かが gitpython の解決策または代替案を知っていますか?
アイデアをありがとう。
Dulwich masterでは、dulwich.porcelain.remote_add メソッドを使用できます。
from dulwich import porcelain
porcelain.remote_add('origin', 'http://github.com/git/git')
古いバージョン (porcelain.remote_add がない) では、次のようなものを使用できます。
from dulwich.repo import Repo
c = Repo('.').get_config()
c.set(('remote "origin"', ), "url", "http://github.com/git/git")
c.write_to_path()