如何将包含文件的现有文件夹添加到 SVN? [英] How to add an existing folder with files to SVN?

查看:41
本文介绍了如何将包含文件的现有文件夹添加到 SVN?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将没有版本控制的文件夹添加到特定的 SVN 位置?我经常开始写代码,只有在我有几个包含代码文件的文件夹后,我才会将它添加到 SVN.

How do you add a folder without version control to a specific SVN location? I often start writing code and only after I have a few folders containing code files do I add it to SVN.

我通常做的是:

  1. svn co 父目录,我想在其中创建一个新文件夹来存储我的代码.
  2. svn mkdir 来创建我想要放置代码的目录.
  3. 复制并粘贴我的代码.
  4. svn commit.
  5. 删除我当前的工作代码目录.
  6. 使用 svn co 重新创建我的工作代码目录.
  1. svn co the parent directory where I want to make a new folder to store my code.
  2. svn mkdir to make the directory I want to put my code in.
  3. Copy and paste my code over.
  4. svn commit.
  5. Delete my current working code directory.
  6. Re-create my working code directory using svn co.

推荐答案

假设我在目录 ~/local_dir/myNewApp 中有代码,我想把它放在 'https://svn.host/existing_path/myNewApp'(同时能够忽略一些二进制文件、供应商库等).

Let's say I have code in the directory ~/local_dir/myNewApp, and I want to put it under 'https://svn.host/existing_path/myNewApp' (while being able to ignore some binaries, vendor libraries, etc.).

  1. 在存储库中创建一个空文件夹 svn mkdir https://svn.host/existing_path/myNewApp
  2. 进入项目的父目录,cd ~/local_dir
  3. 检查本地文件夹上的空目录.不要害怕 - 您在本地拥有的文件不会被删除.svn co https://svn.host/existing_path/myNewApp.如果您的文件夹在本地与存储库中的名称不同,则必须将其指定为附加参数.
  4. 您可以看到 svn st 现在将您的所有文件显示为 ?,这意味着它们当前不受版本控制
  5. 对要添加到存储库的文件执行 svn add,并将其他文件添加到 svn:ignore.当您只想选择性地添加一些时,您可能会发现 svn help add 的一些有用选项,例如 --parents--depth empty文件/文件夹.
  6. 使用 svn ci
  7. 提交
  1. Create an empty folder in the repository svn mkdir https://svn.host/existing_path/myNewApp
  2. Go to the parent directory of the project, cd ~/local_dir
  3. Check out the empty directory over your local folder. Don't be afraid - the files you have locally will not be deleted. svn co https://svn.host/existing_path/myNewApp. If your folder has a different name locally than in the repository, you must specify it as an additional argument.
  4. You can see that svn st will now show all your files as ?, which means that they are not currently under revision control
  5. Perform svn add on files you want to add to the repository, and add others to svn:ignore. You may find some useful options with svn help add, for example --parents or --depth empty, when you want selectively add only some files/folders.
  6. Commit with svn ci

这篇关于如何将包含文件的现有文件夹添加到 SVN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆