备份分支
我将创建一个分支来处理我的代码,因为主干以难以想象的方式混乱(但这不是问题)。如何定期备份我创建的分支。它将位于我公司的服务器上,我不确定定期将分支签入新文件夹是否相当于“备份我的分支”?
这与直接访问存储库并将文件夹复制到我的桌面有什么不同吗? .svn 文件是否包含保留分支历史记录并能够恢复到以前的修订版本所需的所有内容?
谢谢!
更新**
我问的原因是因为我不知道是否有一天有人会来删除分支。
I am going to create a branch to work on my code, since the trunk is messed up in ways unimaginable (but that's not the issue). How can I periodically backup the branch I create. It would be located on my companies server, and I wasn't sure if periodically checking out the branch into a new folder is equivalent of "backing up my branch"?
Is that any different than just going to the Repo and copying the folder to my desktop? Do the .svn files contain everything I need to retain my branch history, and be able to revert to previous revisions?
Thanks!
Update **
The reason I ask is because I don't know if someone is going to come along one day and delete the branches.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如是说 Chobo:
更新 **
原因我问这个问题是因为我不知道是否有一天有人会删除分支。
在 Subversion 中,你所做的一切都是可逆的。即使您删除了一个分支,您也可以通过简单地将其从删除之前的修订版复制回来来将其恢复。
例如,假设您的分支在修订版 100 中被删除:我们将使用
@99
将分支复制回来,现在它又回来了!
如果您确实想保护您的分支,您可以使用预提交挂钩来防止人们修改文件夹和文件。我有一个此处使用的。
Thus Spaketh Chobo:
Update **
The reason I ask is because I don't know if someone is going to come along one day and delete the branches.
In Subversion, everything you do is reversible. Even if you delete a branch, you can get it back by simply copying it back from the revision before it was deleted.
For example, let's say your branch was deleted back in revision 100: We'll copy the branch back using the
@99
And, now it's back!
If you really want to protect your branches, you can use pre-commit hooks that prevent people from modifying folders and files. I have one I use here.
不需要备份分支,Subversion 是一个版本控制系统。当变化发生时,您知道谁做的、何时做的、更改了什么,甚至可以撤消他们的更改。这就是版本控制系统的作用。
There is no need to backup a branch, Subversion is a version control system. When changes happen, you know who did it, when they did it, what they changed and you can even undo their changes. This is what a version control system does.
您可以这样想您的 svn 服务器:
每次更改服务器的状态时,它都会创建该状态的快照,并用修订号进行标识。
任何时候您想要引用该状态时,都可以查看该修订号。
现在,这并不是它的工作原理 - 如果它为每个更改创建一个完全独立的快照,那么在空间方面(也可能在时间方面)效率将非常低。但是,它的设计目的是让您像这样做一样进行操作,并且它确实会为您重新创建它。
因此,您的备份包括打开
一个文档(我们称之为 backup.txt)。
在存储库上执行 SVN INFO 以获得当前修订号
写下“备份”,您的日志中会显示“我在该日期进行了备份。要获取备份状态,我只需检查日志中的修订版本。 ”
基本上,您所要求的不仅是颠覆的内置内容,而且确实是颠覆的目的。 :)
You can think of your svn server like this:
Every time you make a change to the state of the server, it creates a snapshot of that state that is identified with the revision number.
Any time you want to reference that state, you check out that revision number.
now, that isn't exactly how it works - it would be incredibly inefficient space wise (and probably time wise too) if it created an entirely separate snapshot for every change. But, it is designed to allow you to operate as if it did that, and it does recreate it like that for you.
So your backup consists of doing this
Opening a document (let's call it backup.txt).
doing an SVN INFO on the repository to get the current revision number
Writing down "Backup " and there's your log that says "I made a backup on this date. To get that backed up state, I just check out the revision in the log."
Basically, what you're asking for not only is built into subversion, but indeed is the purpose of subversion. :)
不会。.SVN 文件夹不保留任何历史记录。所有历史记录都位于服务器上的存储库中,这就是您应该备份的内容。
No. The .SVN folders do not keep any history. All the history is in the repository on the server, and that is what you should backup.
您实际上并不需要备份您的分支。修订控制保留所有修订。任何时候,您想查看版本,都可以运行 checkout 命令 以及版本号
请参考:http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.checkout.html
You don't really need to back-up your branch. A revision control keeps all the revisions with it. Anytime, you want to check out a version, you can run checkout command with the version number
refer: http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.checkout.html