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

问题描述 投票:4回答:1

我使用这里的说明建立了一个git仓库。https:/git.help.collab.netentries22564277-Migration-from-Perforce-to-GIT。

我有一个主分支,我在那里从perforce获得最新的信息,并将我的修改提交给perforce。我也有一个开发分支,在那里我做我的工作,有时我会有一个功能分支(从开发分支)。

我一直在尝试找出正确的工作流程,以下是我现在的情况--如果有更好的方法,请纠正我。

1) git checkout master

2) git p4 rebase(从perforce获取最新的,我应该用 "git p4 sync "来代替?

3) git checkout 开发

3) git merge master (将开发版更新到最新)

4) git commit... (做我所有的工作和提交)

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

6) git p4 sync (从perforce中提取最新的版本)

7) git合并开发

8) 解决任何冲突

9) git p4 rebase (从perforce中拉出最新的版本,然后在它的基础上重构我已提交的修改)

10) git p4 submit

在 "git p4 commit "之前,是否应该使用 "git p4 rebase"? 另外,对于我的模型工作流来说,合并是否比rebasing更好?

git merge perforce git-rebase
1个回答
2
投票

http:/owenou.com20110323git-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”

对于最后一件,原因是当你运行 "git merge "时,Git会在堆栈上创建一个额外的提交,用于合并。这不是我们想在远程非git仓库中显示的东西。所以我们用 "git rebase "来合并代码。

© www.soinside.com 2019 - 2024. All rights reserved.