Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore folder without removing it from my repository

Tags:

repository

svn

I have this tmp/ and cache/ directories, that keep generating files that don't need to be commited.

How can I set it so svn ignores them, but doesn't delete them or remove them from the repository, they are needed for the site to work.

like image 744
mgPePe Avatar asked Jul 30 '11 08:07

mgPePe


People also ask

How do I ignore a folder in git repository?

If you want to maintain a folder and not the files inside it, just put a ". gitignore" file in the folder with "*" as the content. This file will make Git ignore all content from the repository. But .

How do I hide a folder in my github repository?

Just mark your repository as private by going to your repository's Settings -> Danger Zone -> Change repository visibility.

How do I ignore files while pushing to git repository?

Excluding local files without creating a .Use your favorite text editor to open the file called . git/info/exclude within the root of your Git repository. Any rule you add here will not be checked in, and will only ignore files for your local repository.


2 Answers

$ cd /path/to/app/tmp
$ svn propset svn:ignore '*' .
$ cd /path/to/app/cache
$ svn propset svn:ignore '*' .

EDIT: Here's the steps if you already previously committed

$ cd /path/to/app/tmp
$ svn st
M slkdjfag.jpg
M gasgsag.png
. #bunch of M's

$ svn rm * --force
$ svn ci -m'trunk: cleaning up tmp directory'
$ svn propset svn:ignore '*' .
$ touch a
$ svn st // shouldn't output anything
like image 75
Andreas Wong Avatar answered Oct 06 '22 14:10

Andreas Wong


The command is:

svn propedit svn:ignore ./some_path

You can use * for "any chars" in the path like, *.project if you want.

Tortoise svn is a good solution for user friendly interface(like Petar Ivanov says). If you are on PC it's "must have" software. If you are on other OS or want full control of svn I suggest you read more about command line working with svn. It's not hard and google knows many things about it :)

you can read more about it: here

And more about cmd svn: here

like image 22
Lachezar Todorov Avatar answered Oct 06 '22 12:10

Lachezar Todorov