简体   繁体   中英

SVN Ignore - how to ignore the content of a directory

I have a large project on a live server which I would like to commit to an svn repo. I have added all files and directories to the repository using svn add .

The problem is that there is a folder-structure that I want to commit but without its content. The folder name is:

 /home/myproject/media/ 

It contains various folders such as images, adverts news, home-images, etc. I would like to commit these folders but not their content. I have tried doing the following:

 cd /home/myproject/media/ svn propedit svn:ignore ./homeimages/ {{The text editor comes up}} I entered * and saved 

but when I do

svn stat

the files under homeimages are still listed in the repository. How can I resolve this issue?

Once added to subversion, the svn:ignore property no longer applies. You will first have to do an svn remove on the contents of your media folder. Once that is done, SVN should ignore the files as you requested.

I use SVN client (Tortoise SVN) and it has ignore-on-commit functionality. Try use that.

You can revert adding files and leave only folders added.

svn revert --depth files

You will have to do it in every subfolder of /home/myproject/media/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM