【问题标题】:Why am I getting this error trying to use git with svn为什么我在尝试将 git 与 svn 一起使用时出现此错误
【发布时间】:2013-02-12 21:39:23
【问题描述】:

为什么我在尝试将 git 与 svn 一起使用时会出现此错误。我正在执行以下步骤并遇到一些疯狂的错误。

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

我得到以下输出

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

请帮帮我

【问题讨论】:

  • 在您尝试创建新分支之前,git status 在“master”中说了什么?
  • 您是否处于混合操作系统开发环境中,其中不同的用户可能使用具有不同行尾约定的系统(Windows、Linux 和 MacOS)?

标签: git git-svn


【解决方案1】:

作为twalbergmentionedissue 103 中的说明,请确保在克隆和变基之前键入:

git config --global core.autocrlf false

您不希望 git 自动更改任何内容(如“Error rebaseing/updating a git-svn repository”)。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-03-07
  • 2014-11-24
  • 2021-09-13
  • 1970-01-01
  • 1970-01-01
  • 2013-08-14
  • 1970-01-01
  • 2011-12-22
相关资源
最近更新 更多