windows - git 和 subversion 可以一起玩吗?

标签 windows svn git

我最近决定尝试使用 git,并且非常喜欢使用 git,即使是在 Windows 上也是如此。

我当前的开源项目 lives on subversion ,所有开发人员都熟悉颠覆,所以我想暂时将颠覆作为“真理之源”。

尽管如此,我想使用 git,所以我继续创建了源代码的副本 on github使用 git svn .我所有的工作都是针对 github 中的源代码完成的,并将我的更改推送到 github。每隔几天我也会将我的更改推送到 svn 和 rebase。

最初的导入似乎没问题,但现在每次我执行“git svn rebase”时,我都会不断遇到冲突,即使是在我的 get 存储库中没有更改的文件上也是如此。这导致我 much pain .

例如。

$ git svn rebase
First, rewinding head to replay your work on top of it...
Applying: Added git ignore file
c:/Users/sam/Desktop/MediaBrowserGit/trunk/.git/rebase-apply/patch:12: trailing
whitespace.
*/obj/*
error: .gitignore: already exists in index
Using index info to reconstruct a base tree...
:12: trailing whitespace.
*/obj/*
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Failed to merge in the changes.
Patch failed at 0001 Added git ignore file

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/git-svn: command returned error: 1

我的问题:

  1. 有什么方法可以告诉 git 使用 svn 作为源与 svn 同步,这样我就可以从头开始。 (导出最新的,检查更改并在某处重置 svn 引用)

  2. 是否有任何提示和技巧可以使此场景始终如一地工作?

  3. 我应该有core.safecrlf and core.autocrlf吗?选项设置为真?看来我需要跳一些圈套。

相关:

似乎让行尾正确是一种魔法。

(我意识到这个问题可能需要扩展,需要扩展的地方请评论)

最佳答案

您是否遇到行尾冲突? Git 有一些配置属性,您可以设置它们来更改它处理行尾字符的方式。我有以下设置:

# this makes git NOT attempt to convert line endings on commit and checkout
core.autocrlf=false

# this makes git check if the conversion done by autocrlf would be reversible
# this is probably not required because I do not have autocrlf turned on
core.safecrlf=true

请注意,我在 Windows 上,我所有的同事都在 Windows 上,我通过 git-svn 与 SVN 交互。这些设置似乎对我有用。

alt text
(来源:codinghorror.com)

关于windows - git 和 subversion 可以一起玩吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/973199/

相关文章:

c - Windows中C语言获取进程用户名

windows - 当我们删除保存的页面时,与保存的网页关联的文件夹被删除的原因

windows - 使 HTML 不适用于 Windows 10 中的 Sphinx 文档

linux - 编辑 Subversion 提交后脚本以启用自动 Hudson 构建

git - 使用 git lfs 有什么好处?

git - 即使在 git lfs 安装后也无法进行 git Push

c++ - 像滚动条一样的远程桌面

linux - 如何为一个存储库执行 git bisect 并转到最新版本导致问题的旧版本?

svn - 建立SVN开发结构

git - SourceTree 不断询问 Github 密码