Altium Version Control
Although Altium Designer 10 (AD10) incorporates it’s own proprietary collaborate, compare and merge feature, you may still want another version control system to manage your entire project (since your project is not likely just going to consist of Altium files). I recommend using a VCS such as Git or Mercurial (see the [Version Control Systems](/programming/version-control-systems page)). Below is a recommended Mercurial ignore file for any project containing Altium files to exclude all the junk that Altium creates.
This code prevents the following files and folders from being version controlled:
*.SchDocPreview
- A recent image of the schematic document, used to display a preview of the file at times such as when you hover the mouse over the project in the project window*.PcbDocPreview
- Same as SchDocPreview, except for the PCB file*.TxtPreview
- Ditto, except for a txt files*.errPreview
- Ditto, except for simulation error files*.nsxPreview
- Ditto, except for simulation netlist files*.LOG
- Log files are pretty pointless, you don’t want to commit these! I made sure thatHistory/
- This folder contains zip files of previous versions of the SchDoc and PcbDoc files. These could potentially be helpful id you ever wanted to revert back to an old state, but since your now using Mercurial for version control, these shouldn’t be needed if you remember to commit regularly!ProjectOutputs/
- ‘Output’ files that Altium creates when you do something like create a BOM
As you may of noticed, I make sure that the files are inside the Altium project root directory before excluding them. This is a safety feature incase you have files in the same repository of the same extension that aren’t Altium’s. I know that the chances of finding a SchDocPreview
outside of Altium is next to none, but you might have log or html files that you want in the repository, and without this safety catch they will get excluded also. This however makes the ignore file less generic, as you have to make sure that <AltiumProjectRoot>
corresponds to the project directory for each repository you use it for. One way to get around this is to standardize your Altium project folder name (e.g. PCB). In this case, <AltiumProjectRoot>
will become PCB. Note that every excluded file type has to have two entries, one to exclude any files in the root directory and one to exclude the file if it exists in any sub-directories. I haven’t been able to work out how to condense this into one line with glob syntax. However, I still highly recommend using the glob syntax, it is conceptually simpler to understand and this glob code is tested and completed to a higher degree the RegExp syntax that is below it.
Using Glob Syntax
Mercurial ignore file for Altium using Glob syntax
Note: Replace <AltiumProjectRoot>
with the name of the folder all your Altium files are stored in, relative to the repository root directory (e.g. PCB
)