Perforce to Git:无效选项:-r

San*_*a K 1 migration git version-control perforce git-p4

我正在尝试将项目从Perforce迁移到Git.我正在使用git-p4我的主要工具为我做繁重的工作,默认情况下在Windows上使用Git:

C:\Program Files\Git\mingw64\libexec\git-core\git-p4.

迁移Perforce公司在Windows到Git,我已经到了我执行我的命令克隆步骤:git p4 clone <PerforceRepo>(其中P4是文件git-p4.py的别名)

我一直收到错误:

选项无效:-r.

C:\P4-To-Git>git p4 clone //depot/C:\build\mainline@all .
Importing from //depot/C:/build/mainline@all into .
Reinitialized existing Git repository in C:/P4-To-Git/.git/
Perforce client error:
        p4 -h for usage.
        Invalid option: -r.
Traceback (most recent call last):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3840, in <module>
    main()
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3834, in main
    if not cmd.run(args):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3706, in run
    if not P4Sync.run(self, depotPaths):
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 3546, in run
    changes = p4ChangesForPaths(self.depotPaths, self.changeRange, self.changes_block_size)
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 852, in p4ChangesForPaths
    changeEnd = p4_last_change()
  File "C:\Program Files\Git\mingw64\libexec\git-core\git-p4", line 317, in p4_last_change
    return int(results[0]['change'])
KeyError: 'change'
Run Code Online (Sandbox Code Playgroud)

我已经查看了p4-git python文件,并且没有使用的地方-r.有帮助吗?

Sam*_*ord 5

尝试设置git-p4.retries为0?

if retries > 0:
    # Provide a way to not pass this option by setting git-p4.retries to 0
    real_cmd += ["-r", str(retries)]
Run Code Online (Sandbox Code Playgroud)

或升级您的p4可执行文件,使其支持-r全局标志 - 在2012.2版本中添加了此选项:

Minor new functionality in 2012.2

    #384638 *** ** *
        The net.maxwait configurable can be used to specify a hard limit
        (in seconds) on the maximum time that a connection will wait for
        any single network send or receive to complete. The 'p4 sync'
        command now supports a '-r' global flag to specify that the sync
        command should be retried if a network error occurs.
Run Code Online (Sandbox Code Playgroud)

  • 不是肯定的(我是一个完整的 git 新手,只是在这里搜索文档)但我认为你想要`git config`?https://git-scm.com/docs/git-config 或者,如果这不起作用,只需获取一个新的`p4` 可执行文件,它是免费下载 (ftp.perforce.com),您所要做的就是替换旧的和新的。 (2认同)