在本地计算机上使用 SVN 临时离线工作
我目前正在 SVN 上进行一个项目。然而,我将有几天无法访问互联网,并且将致力于我的项目。
有没有办法在我的本地计算机上克隆存储库,提交更改,然后当我访问互联网时将它们“推送”到共享存储库上?就 Mercurial 而言,值得完全迁移吗?!
I am working on a project currently on SVN. I however will not have access to the internet for a few days, and will be working on my project.
Is there any way to make a clone of the repository on my local machine, commit changes to it, and when I gain access to the internet "push" them onto the shared repository? Thinking in terms of Mercurial here, is it worth migrating completely?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在我看来,你的问题听起来就像
git-svn
< 的用例/a>:git svn clone http://svn.example.com/project/trunk
,在离线之前将更改提交到 SVNgit svn rebase
使您的 Git 存储库在离线状态下与 SVN 存储库同步git commit
提交到 Git 存储库git svn dcommit
将您的更改推送回 SVN 存储库我每天都在使用此工作流程!
这样做有两个巨大的优势:
Your problem sounds to me like the use case for
git-svn
:git svn clone http://svn.example.com/project/trunk
git svn rebase
to get your Git repo in sync with the SVN repogit commit
git svn dcommit
to push your changes back to the SVN repoI'm using this workflow daily!
You get two huge advantages doing so:
可笑的答案是迁移到另一个版本控制工具,无意冒犯!
我遇到了确切的问题。
一直在“真实”存储库所在的“真实”服务器上使用 SVN。
当我带着我的笔记本电脑出去时,没有互联网,我只需在这台笔记本电脑上复制“真实”存储库(VisualSVN + TortoiseSVN),对其进行处理,更改/提交任何内容,然后回来时只需“同步”新的“修订版”文件到“真实”存储库。
更清楚一点:拥有两台 SVN 服务器,一台位于您的笔记本电脑本地(克隆),另一台位于您的“真实”服务器上(显然)。只需在两者之间同步即可。
Ridiculous answer would be to migrate to another versioning tool, no offence!
I had the exact issue.
Been using SVN on my "real" server where the "real" repository is.
When I went out with my laptop, without internet I would simply duplicate the "real" repository on this laptop (VisualSVN + TortoiseSVN), work on it, change/commit whatever, and when come back simply "sync" the new 'revision' files to the "real" repository.
To be a bit more clear: Have two SVN servers, one locally on your laptop (the clone) and one on your "real" server (obviously). Just sync between the two.
我一直在一个使用 SVN 的项目上使用 git,原因与上面描述的相同。有些人习惯了 git/mercurial,但一段时间后我真的很喜欢这种新方法。此外,我在使用 git-svn 时从未遇到过任何问题,也从未尝试过 Mercurial 和 svn。
如果您正在使用 Mercurial 并且仍在寻找一个好的教程,中间有一个或两个笑声,请查看此 教程 由 Joel Spolsky 编写。正如之前提到的,这无疑是开始使用 DVCS 的绝佳机会。
I've been using git on a project that uses SVN for the same reason you describe above. There is some getting used to git/mercurial but after a while I really like the new approach. Further I never had any issues with using git-svn, never have tried mercurial and svn..
If you are onto Mercurial and are still looking for a good tutorial with one or two chuckles in between check out this tutorial written by Joel Spolsky. And as mentioned before, surely is a great opportunity to get started with DVCS.
您可以使用 Mercurial 访问 svn 存储库。
You can access svn repositories with mercurial.
免责声明:我是 SOS(SVN 离线支持)的作者。
我编写了这个易于使用的命令行工具来准确解决离线使用 SVN 的问题,但它不仅适用于 SVN 签出,而且适用于任何 VCS 工作副本(例如 Bazaar、Git、fossil),甚至在未跟踪的文件中树。 SOS 允许简单的提交、分支、切换/更新操作,而无需传统 VCS 所需的所有复杂语义背景知识。
重新上线后,您可以将所有更改集成回底层 VCS。
网站
安装需要 Python 3,并通过
pip install -U sos-vcs 处理code>
更新
虽然我仍然每天使用 SOS,但代码变得难以维护,需要进行重大重写。这个想法仍然有效,并且可以为类似项目提供灵感。
Disclaimer: I'm the author of SOS (SVN Offline Support).
I wrote this easy to use command-line tool to solve exactly the problem of working with SVN offline, but it works not only within SVN checkouts, but for any VCS working copy (e.g. Bazaar, Git, fossil), or even in untracked file trees. SOS allows simple commits, branching, switch/update operations, without all the complex semantic background knowledge required by traditional VCS.
After coming back online, you can integrate all changes back to your underlying VCS.
Website
Installation requires Python 3, and is handled via
pip install -U sos-vcs
Update
While I still use SOS it daily, the code became an unmaintainable mess requiring a major rewrite. The idea is still valid and may serve as inspiration for similar projects.
总有 SVK 。不过我已经很多年没有使用它了,所以我不确定它的效果如何。
There's always SVK as well. I haven't used it in years though, so I'm not sure of how well it works anymore.