-
-
Notifications
You must be signed in to change notification settings - Fork 954
GitPython: git push --mirror #1246
-
Context:
I want to migrate repository from one SCM provider to an other.. yet I can't use the built-in import repository tools since they can't talk to each other..
I am able to implement it in bash via git commands, but the whole migration is written in Python.
repo = Repo.clone_from(url=f"{url}",
to_path=f"{local_path}", bare=True, mirror=True, recursive=True)
Yet, when I use the flag mirror=True
in the the git.remote.push()
. I don't have the push completed.
remote = repo.create_remote("remote", url=f"{new_url}")
remote.push(mirror=True)
Wondering if it is just not implemented, or I use it wrong.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
GitPython can have a few surprises and in order to avoid that, you could exclusively rely on calling repo.git....
as a handle to the underlying git command.
remote.push(...)
provides access to parsed progress information, but if that is not used there isn't much value in it at all.
Why hooks didn't work as expected I don't know - ultimately it calls the git command.
Line 764 in b11bcfa
Replies: 2 comments
-
Hm, I think I got it..
There was a hook defined blocking the push... but why wasn't I see it as an exception .
Beta Was this translation helpful? Give feedback.
All reactions
-
GitPython can have a few surprises and in order to avoid that, you could exclusively rely on calling repo.git....
as a handle to the underlying git command.
remote.push(...)
provides access to parsed progress information, but if that is not used there isn't much value in it at all.
Why hooks didn't work as expected I don't know - ultimately it calls the git command.
Line 764 in b11bcfa
Beta Was this translation helpful? Give feedback.