0

Here I am trying to migrate my perforce data. The code is below:

from P4 import P4, P4Exception
p4 = P4()
p4.port = "localhost:1666"
p4.user = "xyz"
p4.client = "xyz"
p4.connect()

p4.run("edit", "//Depot/AllFiles/")

Here I need add origin, and the push the files to Git repository using P4Python. Please help me how to do it. I've tried to search every possible way to do it. Or any way I can perform Git P4 operations with python ?

Ambika Sharma
  • 11
  • 1
  • 1
  • 5
  • Have you looked at git-p4? https://git-scm.com/docs/git-p4 – Samwise May 19 '22 at 18:03
  • I did. I wanted it to be in python script or I can perform Git P4 operations through python script. @Samwise – Ambika Sharma May 20 '22 at 05:24
  • git-p4 is not part of P4Python. I think if you want to use git-p4 from a Python script `os.system()` is the way to go, since AFAIK there's no Python API for it. – Samwise May 20 '22 at 13:40

0 Answers0