Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of ".gitignore" file with Subversion [duplicate]

Tags:

svn

I am being forced to work with Subversion on a current project.

Someone has unkindly added the bin and obj folders to the repository.

Other than removing them, and committing the removal, is there an equivalent of .gitignore file I can add to the repository to make the guilty party in the development team never add them again?

I know I can alter my own global ignore pattern, but ideally I'd like the whole development team to be able to share this on a project level.

like image 486
Alex Avatar asked Jul 02 '12 12:07

Alex


People also ask

How do I create an ignore file in svn?

Use the following command to create a list not under version control files. Then edit the file to leave just the files you want actually to ignore. Then use this one to ignore the files listed in the file: svn propset svn:ignore -F ignoring.

Should .gitignore be ignored?

The . gitignore file's purpose is to prevent everyone who collaborates on a project from accidentally commiting some common files in a project, such as generated cache files. Therefore you should not ignore .

Can .gitignore be text file?

A . gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple .


2 Answers

This is done by a svn:ignore property in SVN. This property can be added to a folder. Let us imagine the following:

 +-- root        +-- bin        +-- ... 

to ignore the bin folder you have to set the svn:ignore property onto the root folder. First change into the root folder and do the following on command line:

svn propset svn:ignore "bin" . 

Or you can do this via TortoiseSVN on Windows (file->properties->Subversion Tab).. Further reading in the Subversion book.

like image 165
khmarbaise Avatar answered Sep 22 '22 02:09

khmarbaise


I have just started with Android Studio and I ended up editing the svn:ignore property in the GUI. I used the Edit Properties in the Subversion menu and added a whole bunch of ignores which were mentioned in other posts.

enter image description here

Below is what I ignored and Android Studio marked these visually with different colour after I edited the property.

# built application files *.apk *.ap_  # files for the dex VM *.dex  # Java class files *.class  # generated files bin gen gradle  # Local configuration file (sdk path, etc) local.properties  # Eclipse project files .classpath .project  # Android Studio .idea .gradle local.properties out build production *.iml *.iws *.ipr *~ *.swp 
like image 45
theczechsensation Avatar answered Sep 22 '22 02:09

theczechsensation