使用 SCM 从 Xcode 中的 SVN 中排除文件/目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2182384/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exclude a file/directory from SVN in Xcode with SCM
提问by ACBurk
I would like to exclude a directory from my SVN (I'm using Xcode's built in SCM). It's not checked in but I'm just tired of unselecting it from checkin.
我想从我的 SVN 中排除一个目录(我使用的是 Xcode 内置的 SCM)。它没有签入,但我只是厌倦了从签入中取消选择它。
Most of my SVN experience is at work on Windows with TortoiseSVN, which has a 'Ignore' function; I assume SCM has that same option.
我的大部分 SVN 经验是在 Windows 上使用 TortoiseSVN 工作的,它具有“忽略”功能;我假设 SCM 有同样的选择。
回答by VonC
As mentioned in this SO question(with answers about Xcode's SVN integration), you could still go with the "command-line".
正如this SO question中提到的(关于Xcode的SVN集成的答案),您仍然可以使用“命令行”。
See How to ignore a directory with SVN?
svn propset svn:ignore dirname .
You can see in this Paul Solt's blog entryan example of a new project, managed by XCode, but with a SVN ignore command
您可以在此 Paul Solt 的博客条目中看到一个由 XCode 管理的新项目示例,但带有 SVN 忽略命令
Make a project in
Xcode
and then use Terminal and execute the commands. If you aren't familar withSVN
check out the documentation.
在其中创建一个项目,
Xcode
然后使用终端并执行命令。如果您不熟悉,SVN
请查看文档。
cd LOCAL_PROJECT_PATH
svn mkdir SVN_REPOSITORY_LOCATION/PROJECT_NAME
svn co SVN_REPOSITORY_LOCATION/PROJECT_NAME .
svn add *
svn revert --recursive build
svn ps svn:ignore build .
svn ci
The commands:
- create a folder in your SVN repository.
- Next it checks out the remote repository folder into the local project folder and add all of the project files.
- Once the files are “added” you'll want to remove the build directory and ignore it from your SVN repository.
- Lastly it'll commit the changes and your project is in the repository.
命令:
- 在您的 SVN 存储库中创建一个文件夹。
- 接下来,它将远程存储库文件夹检出到本地项目文件夹并添加所有项目文件。
- 一旦文件被“添加”,您将需要删除构建目录并从您的 SVN 存储库中忽略它。
- 最后它会提交更改并且您的项目在存储库中。
回答by Infrid
VocC is on the money, but don't we also want to ignore the pbxuser files and mode1v3 files?
VocC 是在钱上,但是我们不是也想忽略 pbxuser 文件和 mode1v3 文件吗?
I would change the svn ps svn:ignore build . step for this:
我会改变 svn ps svn:ignore build 。步骤:
svn propset svn:ignore "*.mode1v3
*.pbxuser
bin" .