将现有文件夹放入存储库
我认为直接在记事本中修改文件可能很危险,是时候进行一些适当的源代码控制了(我对源代码控制还很陌生)。我已在我的服务器上安装了 VisualSVN 服务器,并在我的客户端计算机上安装了 TortoiseSVN。我可以很好地创建新文件夹,检查它们等。但是,在我的服务器上,我有一个用于 IIS 的现有文件夹结构,并且到处都有基于此位置的链接。如何在不移动文件的情况下使整个文件夹与 SVN 一起使用?
I've decided that modifying files directly in notepad is probably dangerous and it was about time to have some proper source control (I am quite new to source control). I have installed VisualSVN server on my server and TortoiseSVN on my client machine. I can create new folders fine, check them our etc. However, on my server, I have an existing folder structure in place for IIS and there are links based on this location everywhere. How can I make the entire folder work with SVN without moving the files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有一个简单的解决方案可以签入现有目录结构:
.svn
目录移动到项目的根目录中。这将为所有文件和子文件夹启用 TortoiseSVN 的上下文菜单。There is a simple solution for checking in an existing directory structure:
.svn
directory into the root directory of your project. This enables the context menus from TortoiseSVN for all files and sub-folders.比 Robert's Answer 更简单的方法(尽管是从它中提升的):
打开 TortoiseSVN 的存储库浏览器并创建一个为您要签入的项目创建一个新目录。
从 SVN 签出这个新创建的空目录作为您要添加的目录(忽略有关签出到非空目录的警告)。
在要提交的目录上执行“SVN Commit...”,从提交窗口中选择要添加的文件。
An even simpler way than Robert's Answer (although lifting from it):
Open the repository browser of TortoiseSVN and create a new directory for the project you want to check-in.
Check-out this newly created empty directory from SVN as the directory you are wanting to add (ignore the warning about checking out into a non-empty directory).
Execute 'SVN Commit...' on the directory you are wanting to commit, selecting the files you want to add from the commit window.
我还会在 3 和 4 之间添加一个步骤:
3.5。忽略自动生成的文件(上下文菜单命令添加到忽略列表...)
I would also add a step between 3 and 4:
3.5. Ignore the automatically generated files (context menu command Add to ignore list...)
您可以执行上面其他人提到的操作,但是,如果您只想使用现有的内容而不是添加和提交,则可以简单地愚弄 SVNServe。
对于此示例,我们现有的存储库是“TEST_REPO”
转到命令行。
创建一个名为“new”的新目录。 CD 放入其中。
在我们的“new”目录中运行以下命令:
现在您将在“TEST_REPO”目录中拥有一个存储库。
运行:(
如果需要,用 rd 删除目录,抱歉,不是 Windows 用户)
现在,将文件从现有的“TEST_REPO”移动到“C:\new\TEST_REPO\”文件夹中。然后运行:
您应该看到 SVN 验证存储库中的所有源。简单易行。
You can do what the others above have mentioned, however, if you wish to just use what you have instead of adding and committing, you can simply fool SVNServe.
For this example our existing repo is "TEST_REPO"
Go to your command line.
Create a new directory called "new". CD into it.
In our "new" directory run the following:
Now you will have a repo in the "TEST_REPO" directory.
Run:
(rd to remove directories if needed, sorry, not a windows person)
Now, move the files from your existing "TEST_REPO" into the "C:\new\TEST_REPO\" folder. Then run:
You should see SVN verify all of the source in your repository. Easy peasy.