我正在尝试从Perforce迁移到Git.我们的发展结构如下:
版本1.3.0已创建,开发,发布到生产中.继续发展,版本1.3.1已经分支和开发等.
目前,我们有一大堆版本以递增的顺序创建.我的任务是将这些版本作为连续分支导入,即分支1.3.1来自1.3.0; 分支1.4.0来自分支1.3.1等...
我使用以下命令集:
git init
git config --add git-p4.branchList 1.3.0:1.3.1
#continue configuration for all of the branches
git p4 sync --detect-branches //depot/path/to/code@all
Run Code Online (Sandbox Code Playgroud)
最终的branchList配置看起来像这样:
[git-p4]
branchList = 1.3.0:1.3.0
branchList = 1.3.0:1.3.1
branchList = 1.3.1:1.4.0
branchList = 1.4.0:1.5.0
etc...
Run Code Online (Sandbox Code Playgroud)
当我运行上面的命令时,我收到一个错误:
Importing revision 457240 (18%)
Importing new branch common/1.4.0
Resuming with change 457240
fatal: ambiguous argument 'refs/remotes/p4/common/1.3.1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Command failed: ['git', 'rev-list', '--reverse', '--no-merges', 'refs/remotes/p4/common/1.3.1']
Run Code Online (Sandbox Code Playgroud)
但是,如果我的branchList配置如下所示:
[git-p4]
branchList = 1.3.0:1.3.0
branchList = 1.3.1:1.3.1
branchList = 1.4.0:1.4.0
branchList = 1.5.0:1.5.0
Run Code Online (Sandbox Code Playgroud)
导入完全成功,但分支历史记录未正确反映.
这里有什么问题?
根据您的branchList配置,分支1.4.0是从分支1.3.1创建的.但是在更改列表457240中,第一次找到分支1.4.0,仍然没有找到分支1.3.1!
是否有可能1.4.0和1.3.1都是从1.3.0创建的?
您的branchList配置必须与P4中的集成历史记录匹配.
要确认P4中的集成历史记录,请选择存在于所有分支中且很少修改的文件,并使用P4V"修订图"功能.另一种方法是使用CLI命令p4 filelog //depot/path/to/file.