2013-02-11 15 views
1

爲什麼我得到這個錯誤嘗試使用svn與git。我正在執行以下步驟併發生一些瘋狂的錯誤。爲什麼我得到這個錯誤試圖與svn使用git

git svn clone -s http://svn/java/project project 
cd project 
git svn show-ignore > .gitignore 
git checkout -b dev 

我得到outpput

M src/main/java/app.properties 
M src/main/java/messages.properties 
M src/main/java/org/xxxxx/enrollment/dao/projectDao.java 
M src/main/resources/app.properties 
M src/main/webapp/WEB-INF/flows/start/footer.jsp 
M src/main/webapp/WEB-INF/flows/start/header_edit.jsp 
M src/main/webapp/WEB-INF/flows/start/tobe.jsp 
M src/main/webapp/WEB-INF/spring/mvc.xml 
M src/main/webapp/index.jsp 
M src/test/resources/app.properties 
M src/test/resources/messages.properties 
M src/test/resources/mvc.xml 
Switched to a new branch 'dev 

'

git svn rebase 

我得到這個輸出以下

src/main/java/app.properties: needs update 
src/main/java/messages.properties: needs update 
src/main/java/org/xxxx/enrollment/dao/projectDao.java: needs update 
src/main/resources/app.properties: needs update 
src/main/webapp/WEB-INF/flows/start/footer.jsp: needs update 
src/main/webapp/WEB-INF/flows/start/header_edit.jsp: needs update 
src/main/webapp/WEB-INF/flows/start/tobe.jsp: needs update 
src/main/webapp/WEB-INF/spring/mvc.xml: needs update 
src/main/webapp/index.jsp: needs update 
src/test/resources/app.properties: needs update 
src/test/resources/messages.properties: needs update 
src/test/resources/mvc.xml: needs update 
update-index --refresh: command returned error: 1 

請幫我

+0

在您嘗試創建新分支之前,「master」中的'git status'是什麼意思? – chepner 2013-02-11 20:52:23

+0

您是否處於混合操作系統開發環境中,其中不同用戶可能位於具有不同行結束約定(Windows vs Linux vs MacOS)的系統上? – twalberg 2013-02-11 22:19:32

回答

0

由於mentioned通過twalberg,並在issue 103所示,請確保您鍵入,克隆和重訂基期:

git config --global core.autocrlf false 

你不想Git會自行進行任何更改(如「Error rebaseing/updating a git-svn repository」)。

+0

這個提交做了什麼 – techsjs2013 2013-02-12 13:26:05

+0

@ techsjs2013 commit?它會在你的全局gitconfig(〜/ .gitconfig)中添加一個條目,以確保它不會改變行尾(我錯誤地提到'fileMode':我用'autocrlf'代替它) – VonC 2013-02-12 13:39:18

+0

@ techsjs2013 a有點像在http://stackoverflow.com/a/13888206/6309。對於'autocrlf',請參閱http://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git和http://stackoverflow.com/questions/2333424/distributing- GIT中的配置與 - 的代碼/ 2354278#2354278 – VonC 2013-02-12 13:43:50

相關問題