我想用git使用p4merge,但我得到:
启动p4merge时出错:"path/myFile"是(或指向)无效文件(这列出了文件的BASE,LOCAL,REMOTE和标准版本).
Git告诉我有关冲突然后它询问我是否要启动mergetool配置(p4merge)然后我得到上面的错误.
附加说明:它发生在任何文件!
有关这是什么以及如何解决它的任何线索?
我有一个回购,我做了一个改变,导致合并地狱,我想假装它从来没有存在过.漫长而复杂的故事涉及将预先存在的回购拼接在一个通过git-p4更新的回复之上,但结果是我真的,真的希望git假装从未存在过某种变化.
如果它是Mercurial,我很确定我可以解决我的问题hg strip
,但我在Git中找不到这样的命令.
感谢您提出的任何建议.
我的任务是将我的团队和源码从git迁移到Perforce,我正在寻找有关如何将git历史记录转移到p4的想法.
我很乐意只移动主分支.然而,即使这证明是有问题的.
我正在使用精彩的git-p4工具.我在我的p4工作区中创建了一个目标区域,并用于git p4 clone //depot/StuffFromGit
在git-p4中开始跟踪它.我将所有git存储库的更改移植到git-p4克隆中.然后我就git p4 submit
可以完成,所有的更改都被推送到p4.
当git历史看起来像这样好,线性时,它很有用:
A---B---C---D
Run Code Online (Sandbox Code Playgroud)
问题来自多个人在项目上工作.即使他们正在使用master,仍然会创建分割和合并的分支.不过,git-p4勇敢地处理了这个问题:
A---B---C---E
\--D--/
Run Code Online (Sandbox Code Playgroud)
git p4遍历OK,按顺序提交ABCDE(或ABDCE,任何一个人的历史记录).
例如,当C和D都改变同一个文件时,问题就来了,而E是一个真实的诚实合并.git p4 rebase
失败了; 它将回滚提交,但在回放期间它将首先应用C,然后尝试D并找到冲突.它会停下来,让我合并.好吧,E包含合并,但它要求我手动合并!'git p4 submit'将以类似的方式失败,只是现在它是p4拒绝合并前的更改.
Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging main.cpp CONFLICT (content): Merge conflict in main.cpp Failed to merge in the changes. Patch failed at 0005 Changing main
所以现在我被卡住了.有没有办法消毒git历史或让git-p4理解它?合并就在那里令人沮丧.
我有过的想法:
其中没有一个真的很棒.关于如何git'gt p4 rebase'或'git p4 submit'工作的任何想法?
正如我在前一个问题中提到的,我正在考虑将源代码控制从Perforce迁移到git.
环顾四周,我发现的git-P4(你要挖多一点,因为它不是即使在该链接指向存储库,实际的git-P4脚本很难找到).
我现在正在运行这个脚本,它在新的git存储库中导入了当前版本的文件,但无论我做什么,我都无法获得历史记录.
这是我使用的当前命令行:
P4CLIENT=my-p4-clientspec git-p4 clone --max-changes=1000 --use-client-spec //p4/path/to/be/imported/...
所以,真正的问题是:如果有人设法导入P4仓库,包括历史记录,我想知道你是怎么做到的.
我的p4存储库的结构类似于:
//depot/project/branch1
//depot/project/branch2
//depot/project/branch3
... etc
Run Code Online (Sandbox Code Playgroud)
但是,当我使用git-p4
克隆"项目"时,所有3个分支都不被视为分支,并且所有分支都被克隆到单个主分支中.
这就是我调用的方式git-p4
:
git-p4 clone --detect-branches //depot/project
Run Code Online (Sandbox Code Playgroud)
我期望git-p4
为" project
" 创建一个带有三个分支的git数据库,项目的根将映射到分支名称后的路径部分(例如:if //depot/project/branch1
有一个名为" lib
"(//depot/project/branch1/lib
)的子目录然后我的本地文件系统应该像/git_project/lib
3 git分支一样).
我错的是什么?我调用git-p4
不正确吗?
我浏览过网络,但找不到答案.我想要做的是以下内容:
现在让我们假设git中的引用分支是master
我做的是以下内容:
另一个选择是变基
主要问题是master分支和masterp4分支之间的链接断开.无论如何,我想知道是否有更简单的解决方案.不幸的是,我是一个git n00b.
谢谢你的任何想法,
菲利普
我在Windows上运行,使用windows p4客户端,并通过Cygwin安装git.p4客户端宣传它的语法在不同平台上的规则性以及所有这些,因此应该是hunky-dory.
So when I go to git-p4 clone --verbose //depot/path/to/source
, it lists out all the files in the repository as though they were being checked out, then dies saying
Exception: fast-import failed: warning: Not updating refs/remotes/p4/master (new tip cd601b92da8625c90af05685e450e55b6d19c9e9 does not contain 3a512c9408e3cbeef 94c78dfd7115f81e4a6fd0d)
and concludes with a big block of "git-fast-import statistics". Looking at the error: new tip? Huh? What needs to contain it?
What I'm left with is a .git repo that's a couple of megs …
我做了:
git p4 clone //depot/path/to/project/trunk/@all project
Run Code Online (Sandbox Code Playgroud)
创建master
分支project
.现在我想克隆//depot/path/to/project/release
到release
分支project
.怎么做的?
更新:使用--detect-branches
也不起作用.它报告它正在更新两个分支(当真正有三个分支时)但git branch
报告只有master存在.
我正在尝试将项目从我公司的Perforce仓库导入到git存储库中.我已成功将单个分支转换为单个git仓库,但我想要做的是将整个项目加上所有分支,但我无法使其正常工作.
我有我的.p4settings文件:
P4PORT=perforce-server.local:1666
P4USER=my.username
P4CLIENT=my.clientspec.name
Run Code Online (Sandbox Code Playgroud)
Clientspec非常简单:
//project/... //my.clientspec.name/project/...
-//project/External/... //my.clientspec.name/project/External/...
Run Code Online (Sandbox Code Playgroud)
第二行是从结帐中排除外部库二进制文件.
我使用以下命令行启动git-p4导入:
git p4 clone --verbose --detect-branches --max-changes=100 //project/...@all
Run Code Online (Sandbox Code Playgroud)
这将检查所有分支名称等,并尝试从第一次提交开始导入(此特定项目从changelist 771开始)
Importing from //project/...@all into project
Initialized empty Git repository in /Users/grant/Development/git_test/project/.git/
Reading pipe: git config git-p4.useclientspec
Reading pipe: git config git-p4.user
Reading pipe: git config git-p4.password
Reading pipe: git config git-p4.port
Reading pipe: git config git-p4.host
Reading pipe: git config git-p4.client
p4 -G branches
Opening pipe: p4 -G branches
p4 -G branch -o branch-1
Opening pipe: p4 -G branch …
Run Code Online (Sandbox Code Playgroud) 我试图在我的Linux计算机上使用git p4.但由于某些原因,git-p4似乎存在问题.当我运行git p4命令时,我得到:
fatal: git was built without support for git-p4 (NO_PYTHON=1)
Run Code Online (Sandbox Code Playgroud)
知道为什么要显示这条消息吗?无论如何我能解决它吗?
我使用内核版本3.11.0的Ubuntu发行版.
先感谢您.