git-svn可以像原生Subversion客户端一样处理CRLF吗? [英] Can git-svn be made to handle CRLF like native subversion clients?

查看:458
本文介绍了git-svn可以像原生Subversion客户端一样处理CRLF吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管在Linux上的subversion版本库,但只有通过windows客户端才能访问,因为它是用于大型Windows应用程序的源代码。



如果我可以使用git-svn(由msysgit提供)在此存储库上工作。



我有一段时间试图让存储库不能进入对于windows风格的行结束符有困难。



svn clone 之后检出git仓库:




  • core.autocrlf = true 显示对任何实际使用的文件的修改 LF

  • core.autocrlf = input 在存储库中使用 LF

  • core.autocrlf = false 显示修改所有内容。



这里最好的选择是什么?我应该使用 core.autocrlf = true 并将 LF 提交给 CRLF 更改受影响的文件?



我非常接近抛砖引玉,只是将我的Subversion工作副本放入git存储库。这将是一个糟糕的解决方案,但至少会允许当地的分行和寄存。当它们被添加到Subversion中时,继续添加文件显然会变成巨大的痛苦。



编辑:对于那些有兴趣的人。如果你在Windows上, git-svn 是一个皇家的痛苦。 hasen j的答案可能是正确的,但我不能在没有吸引我团队其他开发人员的愤怒的情况下遵循他的建议。



我基本上放弃了这个因为它不会导致合理的结果。希望接下来的Google代码夏季会吸引那些想要提取他们的在Windows上正确的git-svn支持项目的人。请参阅 http://git.or.cz/gitwiki/SoC2009Ideas#Propergit-svnsupportonWindows

解决方案

由于我的其他答案并不适用于您,下面是处理这种情况的另一种方法:



使用svn和git;在同一个工作目录中。



您将主要使用git,从上游存储库提取内容,进行本地更改,本地分支等;当你在一个本地git项目上工作时,你通常会做的一切。

然后,当你想提交中央svn仓库时,使用svn客户端。

>

我有一些这样做的经验,但我不会做一个 svn commit ,而是用<$创建一个补丁c $ c> svn diff 并提交它(因为我没有任何提交权限)。


I have a subversion repository hosted on Linux but only ever accessed via windows clients as it's for the source of a large Windows application.

It would be awesome if I could work on this repository using git-svn (provided by msysgit).

I'm having a heck of a time trying to get the repository to not get itself in a jam over the windows style line endings.

After svn clone a checkout of the git repository with:

  • core.autocrlf = true shows modifications to any file which actually does use LF in the repository.
  • core.autocrlf = input shows modifications to any file which actually does use LF in the repository.
  • core.autocrlf = false shows modifications to everything.

What's the best option here? Should I use core.autocrlf = true and commit the LF to CRLF changes for affected files?

I'm very close to throwing in the towel and just putting my Subversion working copy into a git repository. This would be a poor solution but would at least allow local branches and stashes. It will obviously become a huge pain to keep adding files when they are added to subversion.

EDIT: For those who are interested. git-svn is a royal pain if you are on Windows. hasen j's answer below is probably the right one but I can't follow his advice without attracting the ire of the other developers in my team.

I'm essentially abandoning this question since it isn't going to lead to a reasonable outcome. Hopefully the next Google Summer of Code will attract someone who wants to pickup their "Proper git-svn support on Windows" project. See http://git.or.cz/gitwiki/SoC2009Ideas#Propergit-svnsupportonWindows

解决方案

Since my other answer doesn't apply well to you, here's another way to deal with the situation:

Use both svn and git; in the same working directory.

You'll mainly be working with git, pulling from the upstream repository, making local changes, local branches, etc; everything that you normally do when you work on a local git project.

Then, when you want to commit to the central svn repo, use the svn client.

I had some experience doing this, only I wouldn't do an svn commit, but instead create a patch with svn diff and submit it (since I had no commit access anyway).

这篇关于git-svn可以像原生Subversion客户端一样处理CRLF吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆