Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best general SVN Ignore Pattern?

People also ask

How do I ignore files 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.

How do I ignore bin and obj folder in svn?

You could add bin folder to ignore list. Right click on the bin folder -> TortoiseSVN -> Unversion and add to ignore list -> bin.


I'll add my own two cents to this question:

I use the following SVN ignore pattern with TortoiseSVN and Subversion CLI for native C++, C#/VB.NET, and PERL projects on both Windows and Linux platforms. It works well for me!

Formatted for copy and paste:

*.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store thumbs.db Thumbs.db *.bak *.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk *.msi* .res *.pch *.suo *.exp *.*~ *.~* ~*.* cvs CVS .CVS .cvs release Release debug Debug ignore Ignore bin Bin obj Obj *.csproj.user *.user *.generated.cs

Formatted for readability:

*.o *.lo *.la #*# .*.rej *.rej
.*~ *~ .#* .DS_Store thumbs.db 
Thumbs.db *.bak *.class *.exe *.dll
*.mine *.obj *.ncb *.lib *.log 
*.idb *.pdb *.ilk *.msi* .res *.pch *.suo 
*.exp *.*~ *.~* ~*.* cvs  CVS .CVS .cvs  
release Release debug Debug
ignore Ignore bin Bin obj  Obj
*.csproj.user *.user
*.generated.cs

Based on Burly's ignore pattern, I have added ReSharper to the ignore list

Formatted for copy and paste:

*.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store thumbs.db Thumbs.db *.bak *.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk .msi .res *.pch *.suo *.exp ~. cvs CVS .CVS .cvs release Release debug Debug ignore Ignore bin Bin obj Obj *.csproj.user *.user _ReSharper.* *.resharper.user

Formatted for readability:

*.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store thumbs.db Thumbs.db *.bak
*.class *.exe *.dll *.mine *.obj *.ncb *.lib *.log *.idb *.pdb *.ilk .msi .res *.pch *.suo *.exp ~. cvs
CVS .CVS .cvs release Release debug
Debug ignore Ignore bin Bin obj Obj
*.csproj.user *.user _ReSharper.* *.resharper.user

My ignore pattern for Visual Studio:

*/bin */obj */Release */Debug *.suo *.err *.log *.obj *.bin *.dll *.exe *.LOG *.user *.pdb [tT]emp [tT]empPE Ankh.Load thumbs.db *.resharper *.vspscc *.vsssccc *.scc */_ReSharper* */_ReSharper.* bin obj *.resharperoptions *.db *.bak *_ReSharper* *.snk logs output TestResults *.crunchsolution.* *.crunchproject.*

Formatted for readability

*/bin */obj */Release */Debug *.suo *.err *.log *.obj *.bin *.dll *.exe 
*.LOG *.user *.pdb [tT]emp [tT]empPE Ankh.Load thumbs.db *.resharper 
*.vspscc *.vsssccc *.scc */_ReSharper* */_ReSharper.* bin obj 
*.resharperoptions *.db *.bak *_ReSharper* *.snk logs output TestResults 
*.crunchsolution.* *.crunchproject.*

Every time I come across a file I generally do not want in the repository, I update the pattern. I believe there is no "best" pattern - it always depends on the language and environment you develop in.

Moreover, you're not very likely to think of all the possible "ignorable" filetypes - you'll always encounter a filetype you simply forgot to include. Thats why updating the pattern as you go works the best.


Windows users might want to throw in desktop.ini and thumbs.db.


Used for my Visual Studio projects

*/bin */obj *.user *.suo

You can expand more file types from there.