简体   繁体   English

SVN具有颠覆性。 日食。 本地仓库

[英]SVN subversive. Eclipse. Local repository

We have a central svn repository where we can check-in and commit new code. 我们有一个中央svn存储库,可以在其中检入并提交新代码。 But I don't want to commit every minor change to central repository. 但是我不想将每一个微小的更改都提交给中央存储库。 So I want to create some local repository with Subversive SVN, which I can use for temporary committing (some minor bug-fixes, etc). 因此,我想使用Subversive SVN创建一些本地存储库,可以将其用于临时提交(一些较小的错误修复等)。 It just for me, for comfort, for example: I make new functionality in 2 implementations, and I still don't know which implementation commit to central repo, but in future I will commit one of it. 例如,仅出于舒适目的,这对我来说:我在2种实现中创建了新功能,但我仍然不知道哪个实现会提交给中央存储库,但将来我会提交其中一种。 So I need to save code of both implementations locally. 所以我需要在本地保存两个实现的代码。

So if it possible to create local repository with subversive SVN , how to do it? 因此,如果可以使用具有破坏性的SVN创建本地存储库,该怎么办? Or may be for my purpose exist some other, more elegant solution? 还是出于我的目的存在其他更优雅的解决方案?

EDIT: When I used Mercurial, I get benefits of using Central(remote) repo, and local repo (so I can commit every minor big-fix locally, and every "big" change of project to central repo). 编辑:当我使用Mercurial时,我得到了使用Central(远程)回购和本地回购的好处(因此我可以在本地提交每个次要的大补丁,以及将项目的每个“大”更改都提交给中央回购)。

I agree with Valentin : SVN does not provide any mechanism to separate a local commit and a remote one. 我同意Valentin的观点:SVN不提供任何将本地提交和远程提交分开的机制。 But GIT does, and is totally designed this way. 但是GIT确实如此,并且完全是通过这种方式设计的。

Unfortunately, it seams that your are working in a group, and maybe don't you have any choice on your version control system. 不幸的是,它表明您正在一个小组中工作,也许您在版本控制系统上没有任何选择。 In that case, it's possible to share a GIT and a SVN repository on the same directory. 在这种情况下,可以在同一目录上共享GIT和SVN存储库。 GIT will help you having a local repository, where you'll be able to commit changes, create branches, and so on... And you will commit major changes on your remote SVN repo. GIT将帮助您拥有一个本地存储库,在该存储库中您可以提交更改,创建分支等……并且您将在远程SVN存储库上提交主要更改。

This solution works well. 此解决方案效果很好。 You just have to add the .git directory into SVN ignore file, and add the .svn directories into the GIT ignore file. 您只需将.git目录添加到SVN忽略文件中,然后将.svn目录添加到GIT忽略文件中。

Hope this helps... 希望这可以帮助...

Git is so intelligent, that you can connect git to the svn repository. Git非常智能,您可以将git连接到svn存储库。 With a command: 使用命令:

git-svn clone -s http://example.com/my_subversion_repo local_dir

Read the detailed tutorial: http://viget.com/extend/effectively-using-git-with-subversion 阅读详细的教程: http : //viget.com/extend/effectively-using-git-with-subversion

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM