什么是正确的Git p4工作流程



我使用此处的说明设置了一个git存储库:https://git.help.collab.net/entries/22564277-Migration-from-Perforce-to-GIT

我有一个主分支,在那里我可以从performce获得最新信息,并向performce提交我的更改。我也有一个开发分支来做我的工作,有时我会有一个功能分支(从开发分支)。

我一直在努力找出正确的工作流程,这就是我现在的处境——如果有更好的方法,请纠正我。

1) git结账主

2) gitp4-rebase(从performce获取最新信息,我应该使用"gitp4-sync"吗?)

3) git校验开发

3) gitmergemaster(将开发更新到最新版本)

4) git提交。。(完成我所有的工作并提交)

5) git checkout master(准备将开发合并到分支

6) git p4 sync(从性能中提取最新)

7) git合并开发

8) 解决任何冲突

9) git p4 rebase(从performce中提取最新内容,然后在其上重新设置我提交的更改的基础)

10) git p4提交

"gitp4-rebase"应该只在"gitp4commit"之前使用吗?对于我的模型/工作流程来说,合并是否比重新建立基础更好?

来源http://owenou.com/2011/03/23/git-up-perforce-with-git-p4.html:

命令

使用git-p4时需要记住的四件事:

Instead of using “git push” to push local commits to remote repository, use “git-p4 submit”
Instead of using “git fetch” to fetch changes from remote repository to local, use “git-p4 sync”
Instead of using “git pull” to fetch and merge changes from remote repository to local, use “git-p4 rebase”
Instead of using “git merge” to merge local branches, use “git rebase”

对于最后一个,原因是当您运行"gitmerge"时,git会在堆栈顶部为合并创建一个额外的提交。这不是我们想要在远程非git存储库中显示的内容。因此,我们将代码与"git-rebase"合并。

最新更新