2013-11-21 112 views
1

我試圖從Perforce轉換爲git並複製了與git p4 clone //depot/path/to/project/[email protected] projectgit push ssh://[email protected]:7999/project.git master的Perforce存儲庫。git-p4 rebase運行到衝突

現在我想讓git存儲庫與Perforce存儲庫保持同步。工程師只能提交給Perforce存儲庫。當我:

$ git clone ssh://[email protected]:7999/project.git 
$ cd project 
$ git p4 sync //depot/path/to/project/[email protected] 
$ git p4 rebase 

它抱怨合併衝突。我不明白爲什麼應該有一個合併衝突,因爲沒有變化應該在git存儲庫本身發生。需要做些什麼來解決這個問題?

+0

我猜對於正常的'git clone'做一個'git p4 sync/rebase'並不滿意。我認爲它只是針對'git p4 clone'而設計的? –

回答

0

Git p4 rebase用於準備從Git提交給Perforce。在你的情況下,你不應該使用它。下面是我工作的同步從Perforce更改爲Git。

git pull 
git p4 sync 
git merge -s recursive -X theirs refs/remotes/p4/master 
git push origin master:master 
+0

正如你注意到的,'git p4'的文檔說:「一個常見的工作模式是從p4倉庫獲取最新的更改,並將它們與本地未提交的更改合併。通常,p4倉庫是所有代碼的最終位置,因此一個rebase工作流程是有意義的。[git p4 rebase]不會'git p4 sync'跟着'git rebase'來**移動本地提交,而不是更新後的p4更改**。「 [着重點]因爲OP沒有本地提交,所以不需要rebase。 –