1

Why am I getting this error trying to use git with svn. I am doing the following steps and getting some crazy errors.

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

I get the following 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

I get this output

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

please help me

techsjs2013
  • 2,607
  • 5
  • 20
  • 25
  • What does `git status` say in "master" before you try to create the new branch? – chepner Feb 11 '13 at 20:52
  • Are you in a mixed OS development environment where different users might be on systems with different line-ending conventions (Windows vs Linux vs MacOS)? – twalberg Feb 11 '13 at 22:19

1 Answers1

0

As mentioned by twalberg, and illustrated in issue 103, make sure that you type, before cloning and rebasing:

git config --global core.autocrlf false

You don't want git changing anything automatically (as in "Error rebaseing/updating a git-svn repository").

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @techsjs2013 commit? It adds an entry in your global gitconfig (~/.gitconfig), in order to make sure it doesn't change the end of line (I mistakenly mentioned only `fileMode`: I replaced it by `autocrlf`) – VonC Feb 12 '13 at 13:39
  • @techsjs2013 a bit like in http://stackoverflow.com/a/13888206/6309. For `autocrlf`, see http://stackoverflow.com/questions/2825428/why-should-i-use-core-autocrlf-true-in-git and http://stackoverflow.com/questions/2333424/distributing-git-configuration-with-the-code/2354278#2354278 – VonC Feb 12 '13 at 13:43