不幸遇到需要改變 svn remote repository 的 url。好不容易找到別人提供的方法,記錄如下:
- 先把專案中的
.git/config
裡面的 svn-remote 的url
改成新的連結。 - 執行
git svn fetch
,拉取最新的內容。 - 換回原先的
url
。 - 執行
git svn rebase -l
,做 local rebase。-l
意思是在 local 做rebase
,而不從 remote 抓取最新的進度。 - 再換回新的
url
。 - 執行
git svn rebase
!
順帶說明一下,一開始我在改變 url 後直接執行 git svn rebase
,得到一個錯誤訊息:
Unable to determine upstream SVN information from working tree history
所以,1~4就是讓 local 能對得上 remote 。最後再透過 6 把 local-remote 對上。