开发者

How to delete temp files from subversion but retain the copy in my local folder?

开发者 https://www.devze.com 2023-03-18 07:16 出处:网络
When we moved to SVN, we just included anything and everything in our folders on subversion. I want to exclude all log files in a folder.

When we moved to SVN, we just included anything and everything in our folders on subversion. I want to exclude all log files in a folder.

I am on Ubuntu.

thinkcode@myserver:~/Project1/Log/*.txt

All the .txt files are on sub开发者_如何学Pythonversion and these log files are created on a daily basis. I want to delete them off of subversion but retain them in my Log folder.

svn propedit svn:ignore ./some_path doesn't seem to do the trick. The new *.txt files are still showing as '?' when doing an svn status.I tried it on a new folder and I get svn: 'c.txt' is not under version control

Any leads are much appreciated!


First, what do you mean in Subversion?

Let's clarify this:

  • Subversion has a place where all files and versions are stored. This is the repository. You never see the actual directory structure of the repository, and you probably don't have read/write access there.

  • You checkout the files from the repository to your local working directory. The working directory reflects a particular version of the various files and directories that are stored in your Subversion repository. However, you have access to them. If you make a change in one of these and commit them, you've updated the repository.


Okay, now that we have that cleared up, I'm going to make the assumption that the files you're talking about are located on your local directory, but not in the source repository. Is that correct?

In this case, the svn:ignore should be on the directory where the log files sit, and should have the value "*.txt". You can do it like this:

$svn propset svn:ignore "*.txt" .

Note the use of quotes around *.txt. They're required in this case. What this will do is prevent new files in that directory from showing up if they match the glob pattern of your svn:ignore when you do a svn status. They will also not be added if you just say svn add:

$ svn add

However, if the files are already in the repository, the svn:ignore property will do nothing. If you want to remove the files from the repository, but keep them on your local disk, you can do this:

$ svn delete --keep-local (files to delete)


The svn status '?' means that an item is not under source control. svn status will list all files under the current directory which are under source control and have been modified or anything not under source control.

Therefore it seems if it's still in your local directory you've already achieved what you wanted to.


It takes two operations, delete and ignore. first mark all the files for delete. Then commit. After that apply ignore, and make sure you apply it recursively.

0

精彩评论

暂无评论...
验证码 换一张
取 消