如何在版本控制下svn添加文件?
我的服务器上有 svn 设置:/home/svn/setup
我也有我希望它们在 svn 控制下的文件:/var/www/html/trunk
我如何在 /home/svn/trunk
内的版本控制下从 /var/www/html/trunk
获取文件?
如果我运行 svnadmin verify /home/svn/setup/
我得到 * Verified revision 0.
setup
是我安装 svn 的位置。我正在考虑将网站文件广告到另一个名为 trunk
的文件夹中,
有什么想法吗?
THnaks
编辑:如果我执行 `svn import /var/www/html/trunk file:///home/svn/trunk -m 'Initial import'
我得到 svn: Unable to open repository 'file:/// home/svn/trunk' `
i have svn setup on my server: /home/svn/setup
i also have the files that i want them under svn control here: /var/www/html/trunk
how do i get the files from /var/www/html/trunk
under version control inside /home/svn/trunk
??
if i run svnadmin verify /home/svn/setup/
i get * Verified revision 0.
setup
is where i have svn installed. im thinking to ad the website file in another folder called trunk
any ideas?
THnaks
edit: if i do `svn import /var/www/html/trunk file:///home/svn/trunk -m 'Initial import'
i get svn: Unable to open repository 'file:///home/svn/trunk'
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须将 svn 存储库检出到 工作副本,在您的情况下为
/var/www/html/trunk
(使用svn checkout
)。然后,添加文件并提交
。顺便问一下,你在本地文件系统上使用 svn 有什么原因吗? Mercurial 或 git 等分布式版本控制系统速度更快、可扩展性更强,并且更易于设置和启动。作为参考,使用 Mercurial,您只需在
/var/www/html/trunk
中输入hg init
,就足以设置存储库。You'll have to checkout the svn repository into a working copy, in your case
/var/www/html/trunk
(withsvn checkout
). Then, add the files andcommit
.By the way, is there a reason why you're using svn on the local filesystem? A distributed version control system such as mercurial or git is faster, more scalable, and easier to setup to boot. For reference, with mercurial, you'd have just to type
hg init
in/var/www/html/trunk
, and that would suffice to setup the repository.这意味着 /home/svn/trunk 不是您的初始存储库所在的位置。您已经设置了 svn,但是您创建了存储库吗?
That means /home/svn/trunk is not where your initial repository is located. You have svn setup, but did you create a repository?