加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 02:48:04 所属栏目:Windows 来源:网络整理
导读:我最近决定采取git暴跌,我真的很喜欢使用git,即使在 Windows上也是如此. 我目前的开源项目lives on subversion,所有开发者都熟悉颠覆,所以我想把颠覆作为现在的“真相来源”. 尽管如此,我想使用git,所以我继续使用git svn创建了源on github的副本.我的??所有
我最近决定采取git暴跌,我真的很喜欢使用git,即使在 Windows上也是如此.

我目前的开源项目lives on subversion,所有开发者都熟悉颠覆,所以我想把颠覆作为现在的“真相来源”.

尽管如此,我想使用git,所以我继续使用git svn创建了源on github的副本.我的??所有工作都是针对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

我的问题:

>有什么方法可以告诉git使用svn作为源同步svn,所以我可以从一个干净的平板开始. (导出最新,签入更改并重置某个地方的svn refs)
>是否有任何提示和技巧让这个场景始终如一地运作?
>我应该将core.safecrlf and core.autocrlf选项设置为true吗?看来我需要一点箍跳.

有关:

> http://kerneltrap.org/index.php?q=mailarchive/git/2008/4/16/1450834/thread
> http://markmail.org/message/vaois4kkr5ggugqs#query:git%20crlf+page:1+mid:i4flex6vmt5tdala+state:results
> http://code.google.com/p/msysgit/issues/detail?id=271

看起来正确的线条结尾似乎是一种黑色艺术.

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

解决方法

你得到了行结束冲突吗? 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 http://www.codinghorror.com/blog/images/works-on-my-machine-starburst.png

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读