如何将包含文件的现有文件夹添加到 SVN? [英] How to add an existing folder with files to SVN?
本文介绍了如何将包含文件的现有文件夹添加到 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.
我通常做的是:
- svn co 父目录,我想在其中创建一个新文件夹来存储我的代码.
- svn mkdir 来创建我想要放置代码的目录.
- 复制并粘贴我的代码.
- svn commit.
- 删除我当前的工作代码目录.
- 使用 svn co 重新创建我的工作代码目录.
- svn co the parent directory where I want to make a new folder to store my code.
- svn mkdir to make the directory I want to put my code in.
- Copy and paste my code over.
- svn commit.
- Delete my current working code directory.
- 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.).
- 在存储库中创建一个空文件夹
svn mkdir https://svn.host/existing_path/myNewApp
- 进入项目的父目录,
cd ~/local_dir
- 检查本地文件夹上的空目录.不要害怕 - 您在本地拥有的文件不会被删除.
svn co https://svn.host/existing_path/myNewApp
.如果您的文件夹在本地与存储库中的名称不同,则必须将其指定为附加参数. - 您可以看到
svn st
现在将您的所有文件显示为?
,这意味着它们当前不受版本控制 - 对要添加到存储库的文件执行
svn add
,并将其他文件添加到svn:ignore
.当您只想选择性地添加一些时,您可能会发现svn help add
的一些有用选项,例如--parents
或--depth empty
文件/文件夹. - 使用
svn ci
提交
- Create an empty folder in the repository
svn mkdir https://svn.host/existing_path/myNewApp
- Go to the parent directory of the project,
cd ~/local_dir
- 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. - You can see that
svn st
will now show all your files as?
, which means that they are not currently under revision control - Perform
svn add
on files you want to add to the repository, and add others tosvn:ignore
. You may find some useful options withsvn help add
, for example--parents
or--depth empty
, when you want selectively add only some files/folders. - Commit with
svn ci
这篇关于如何将包含文件的现有文件夹添加到 SVN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文