如何在PHPstorm中使用SVN忽略文件/文件夹 [英] How to ignore files/folders using SVN in PHPstorm

查看:1107
本文介绍了如何在PHPstorm中使用SVN忽略文件/文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个新的存储库,但不想包含带有缓存文件等的文件夹.我尝试了所有操作,但它始终提交所有文件和文件夹.在我的项目概述中,对于SVN,这些文件夹被标记为已忽略",并且在进行初始导入时,我取消选中用于提交被忽略的文件/文件夹的框.

I want to create a new repository but don't want to include folders with cachefiles etc. I tried everything but it keeps committing all files and folders. In my project overview the folders are marked as 'ignored' for SVN and when doing a initial import I uncheck the box for committing ignored files/folders.

推荐答案

从PHPStorm网站上的版本控制有助于我发现"提交忽略的文件/文件夹的框 em>"

Judging from the fact that on the PHPStorm web site version control helps I can find no mention of "the box for committing ignored files/folders"

听起来像是你

  1. 将文件/目录的负载设置为忽略
  2. 开始提交,但
  3. ,在提交中包括.svnignore
  4. 发现您的忽略项将被忽略.
  1. Setting a load of files/directories up as ignored
  2. Starting a commit but
  3. Not including .svnignore in the commit
  4. finding your ignores are ignored.

问题在于svn将要忽略的内容的详细信息存储在名为.svnignore的文件中,如果您希望忽略的内容对所有用户都是持久的并且是通用的,则必须自己提交.

The problem is that svn stores the details of what to ignore in a file called .svnignore which, if you would like your ignores to be persistent and common to all users, has to be committed itself.

我认为最适合您的用例的过程如下(如果我正在教奶奶吸卵,很抱歉),假设您的裸仓库已经存在并且具有如下标准结构:

I think that the process that best fits your use case here is as follows, (sorry if I am teaching grandma to suck eggs), assuming that your bare repository already exists and has a standard structure like:

URL/trunk
URL/tags
URL/branches

这是命令行工具的常规过程,但可以进行调整:

This is the general process with the command line tools but can be adapted:

mkdir a_new_directory
svn co URL/trunk a_new_directory
cd a_new_directory

将项目的目录结构复制到此处,包括您要忽略的目录结构(没有文件就是目录). 在文本文件列表中,您要忽略的所有目录的相对路径,每行一个,如果您没有窗口,则每个目录都带有正斜杠,而所有目录都以正斜杠结尾:

Copy the directory structure of your project to here including the ones you would like to ignore, (no files just the directories). In a text file list the relative path of all the directories you would like to ignore, one per line, each with forward slashes if you are no windows and all ending with a forward slash:

svn propset svn:ignore -F the_text_file.txt

如果您要普遍忽略某些文件类型,例如.bat和.obj文件:

If you have some file types that you would like to universally ignore, e.g. .bat and .obj files:

svn proprev svn:ignore -R *.bat
svn proprev svn:ignore -R *.obj

我个人将带有每个目录描述的dir_info.txt文件放到该目录中,并添加它们.

I personally put a dir_info.txt file with a description of each directory into that directory and add them.

svn添加所有目录(和dir_info.txt文件),然后提交.

svn add all the directories, (and dir_info.txt files), then commit.

然后将文件添加到目录,svn添加文件并提交.

Then add your files to the directories, svn add them and commit.

这篇关于如何在PHPstorm中使用SVN忽略文件/文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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