Ignoring files and folders with Bazaar Source Control
Posted by Kash Farooq on September 15, 2009
Continuing the series of blog posts to help you move away from subversion.
In Subversion, you can ignore files or whole sub folders with Subversion properties. Unfortunately, you have to do this everytime you add a new project to your source code structure – for example, you have to add Subversion properties to ignore the new obj and bin folders.
With Bazaar you can also ignore a specific file or directory. e.g. to ignore a directory:
bzr ignore src/myproj/bin
The first time you ignore a file, a .bzrignore file is created. This file contains all the files and folders you want BZR to ignore. You can push this file to a shared repository and then everyone who makes a branch from the shared repository will ignore the same files.
Rather than ignoring files and folders individually, you can update this file yourself to add pattern matching file paths you want ignored. Paste the following into your .bzrignore to ignore all bin folders, obj folders, ReSharper folders and associated files, and Dev Studio files that you normally do not put in source control:
**/bin **/bin/** **/*.user **/obj **/obj/** **/*.sln.cache **/*.suo **/aspnet_client **/*_ReSharper*.* **/*.resharper
Now, when you commit .bzrignore and push this file back to the shared repository, everyone who pulls the changes to their branches will ignore the same files.
To always ignore these files for all of your BZR branches, you can paste the above code the global ‘ignore’ file. You can find this at:
- Windows Vista: C:\Users\your-user-name\AppData\Roaming\bazaar\2.0\ignore
- Windows XP/2003: C:\Documents and Settings\your-user-name\ApplicationData\bazaar\2.0\ignore
Sorry, the comment form is closed at this time.