Setting ignore files and directories options
You can define rules to ignore files and directories when recursively adding files, viewing working directory differences, and pushing changes to repositories. For example, you may have debug files in your working directory that you do not want to add to Surround SCM. You can define rules to ignore those files unless they are selected when recursively adding files.
The rules are saved to a .sscmignoreuser file in your home directory, which is usually defined in an environment variable in your operating system.
Operating system | Environment variable | Default home directory |
---|---|---|
Windows | %USERPROFILE% | C:\Users\<Username> |
macOS | $HOME | /Users/<username> |
Linux | $HOME | /home/<username> |
1. Choose Tools > User Options then select Ignore Files and Directories.
2. Enter the rules for files and directories to ignore. See Example rules.
- Rules are case sensitive on Windows and not case sensitive on macOS and Linux.
- Each rule applies to a file or directory name. Absolute paths are not matched.
- To indicate a rule only applies to directory names, end the line with /. For example, Users/.
- To indicate a line is a comment, start the line with #. For example, #This is a comment.
- Rules use a glob-style pattern when you use the supported symbols. If a rule does not use these symbols, it is interpreted as a regular string match for a file or directory name.
Symbol/structure | Matches: | Example |
---|---|---|
* | One or more characters | *.exe matches any string that ends in .exe |
? | One character | .?at matches files that end in .dat, .bat, and any files that have a single character that follows a period and end with ‘at’. Does not match .at or .data. |
[<characters>] or [<character start-character end range>] | One character that is between the brackets. Character ranges are supported. For example, [abc] or [a-c]. | *.[gp]ch matches strings that end in .gch and .pch only *.[b-d]at matches strings that end in .bat, .cat and .dat |
[!<characters> or [!<character start-character end range>] | One character that is not between the brackets. Character ranges are supported. For example, [!xyz] or [!x-z]. | *.[!dc]at matches strings that end with .bat, but not .cat or .dat *.[!d-h]pp matches strings that end in .cpp (and others), but does not match strings that end in .dpp, .epp, .fpp, .gpp or .hpp |
- Special characters (e.g., [], *, ?, !, -, \) can be matched, but must be escaped with \.
3. Click OK to save the changes.
The rules are saved to the .sscmignoreuser file in your home directory.
# Ignore all object files (Windows and Unix)
*.o
*.obj
# Ignore all cpp and hpp files
*.[ch]pp
# Ignore node_modules directories
node_modules/
# Ignore files and folders named bin
bin