2009-10-25 16 views
2

我想讓本地GIT存儲庫與遠程GIT和SVN存儲庫同步。永無止境的GIT故事 - 我在這裏做錯了什麼?

我正在執行步驟如下:

> git push
Everything up-to-date

> git pull
Already up-to-date.

好吧,我的遠程GIT回購似乎是罰款爲止。

> git svn rebase
First, rewinding head to replay your work on top of it...
Applying: Fixing some javadoc problems.
Using index info to reconstruct a base tree...
<stdin>:13: trailing whitespace.
\t
<stdin>:21: trailing whitespace.
\t\t\t\t<configuration>
<stdin>:22: trailing whitespace.
\t\t\t\t\t<links>
<stdin>:23: trailing whitespace.
\t\t\t\t\t\t<link>http://java.sun.com/javase/6/docs/api/</link>
<stdin>:24: trailing whitespace.
\t\t\t\t\t</links>
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging lilith-parent/pom.xml
我替換\噸爲了清楚標籤。

這是我已經完成的合併,以前...
我現在有一個新的本地版本。

> git svn dcommit
[commits the new version to SVN... again...]

現在掌握和軀幹都在我的本地庫的頭。

> git push
To ssh://[email protected]/gitroot/lilith/lilith
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'ssh://[email protected]/gitroot/lilith/lilith'

這意味着,據我所知,我必須首先執行一拉。 SOOOO ....

> git pull
Already uptodate!
Merge made by recursive.

這使我回到了最開始... :(沖洗和重複。

我有我的思念的感覺這裏有一點非常重要,任何人都可以向我解釋這一點嗎?

+0

好吧,我能解決我的眼前的問題發出「混帳推產地:碩士其次是「混帳推出身」。這將我的git存儲庫重置爲更加健全的狀態(即沒有我在此期間創建的5個合併)。我想我會在未來避免與svn的重新同步,因爲這可能是不值得的。謝謝你的幫助! – Huxi 2009-10-25 21:38:29

回答

4

無法通過git-svn通過svn跟蹤一個分支,並且通過push/pull通過git跟蹤。你應該讓這兩個分支分開並做同步分行git rebase本地,當你想這些分支

+0

感謝您的信息。 「不能這樣做」是我需要知道的。 – Huxi 2009-10-25 21:43:39

4

最大的線索之間傳輸的提交是在推錯誤:

! [rejected] master -> master (non-fast forward) 

這意味着你」重新顛覆分支和你的遠程git master分支沒有達成一致。一些變化被推到/承諾到一個不在另一箇中。火起來gitk --all,它應該給你一個線索,哪裏出了問題 - 尋找歷史上的「叉子」。注意分支機構[origin/master],[master][trunk]。起源可能與您當前的主控制器有不同的分支 - git svn rebase可能會導致這種情況。

通常,如果您通過svn和git進行提交,那麼最好保持git master分支與subversion相同,並在git的另一分支上工作。見this other SO question about working with git and subversion

+0

我只是想感謝你的其他SO問題的鏈接。它幫助我進一步瞭解。我很難決定你或帕維爾是否應該得到答案檢查並解決了「帕維爾更快」的問題。 :p理想情況下,我會給你兩個答案複選標記。 – Huxi 2009-10-25 21:42:32

相關問題