har*_*ant 6 git perforce git-p4
安装git之后- 我尝试克隆现有的p4分支,但它失败并显示以下信息:
c:\P4_GIT\DT>git p4 clone //depot/CTAT/Windows/OneP/
fatal: 'p4' appears to be a git command, but we were not
able to execute it. Maybe git-p4 is broken?
Run Code Online (Sandbox Code Playgroud)
Gabriel Morin 的回答对我来说是最好的,但它是不完整的:
[alias]
p4 = !'C:\\Program Files\\Python27\\python.exe' 'c:\\program files\\Git\\mingw64\\libexec\\git-core\\git-p4'
Run Code Online (Sandbox Code Playgroud)
p4 set P4PORT=<server>:1666
p4 set P4USER=<user>
p4 set P4PASSWD=<password>
p4 set P4CLIENT=<some name>
Run Code Online (Sandbox Code Playgroud)
至少在 2017 年 10 月,这并没有那么复杂:
我安装了适用于 Windows 的 Python 2.7.x、适用于 Windows 2.14.2 的 Git 和 Perforce 命令行工具。我将所有三个都放在我的路径上并测试我是否能够从命令行调用python,git和p4。然后我可以将它添加到我的 gitconfig 中:
[alias]
p4 = !python.exe 'c:\\program files\\Git\\mingw64\\libexec\\git-core\\git-p4'
Run Code Online (Sandbox Code Playgroud)
然后git p4从命令行使用工作。
我在Git for Windows 2.16.1.4上看到了这个并通过替换"C:\ Program Files\Git\mingw64\libexec\git-core\git-p4"中的shebang来修复它.
我换了:
#!/usr/bin/python2
Run Code Online (Sandbox Code Playgroud)
有:
#!/usr/bin/env python
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3185 次 |
| 最近记录: |