.gitignore for MATLAB

16 ignore rules for MATLAB, ready to copy into your repository.

Numerical computing environment

The complete .gitignore for MATLAB

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:29:57 UTC
# Technologies: MATLAB

### MATLAB ###
*.asv
*.m~
*.autosave
*.slx.r*
*.mdl.r*
*.p
*.mex*
*.mlappinstall
*.mltbx
*.ctf
helpsearch*/
slprj/
sccprj/
codegen/
*.slxc
.MATLABDriveTag

What these MATLAB rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Autosave files

Pattern What it ignores
*.asv Autosave files
*.m~ Autosave files
*.autosave Autosave files
*.slx.r* Autosave files
*.mdl.r* Autosave files

Derived content-obscured files

Pattern What it ignores
*.p Derived content-obscured files

Compiled MEX files

Pattern What it ignores
*.mex* Compiled MEX files

Packaged app and toolbox files

Pattern What it ignores
*.mlappinstall Packaged app and toolbox files
*.mltbx Packaged app and toolbox files

Deployable archives

Pattern What it ignores
*.ctf Deployable archives

Generated helpsearch folders

Pattern What it ignores
helpsearch*/ Generated helpsearch folders

Code generation folders

Pattern What it ignores
slprj/ Code generation folders
sccprj/ Code generation folders
codegen/ Code generation folders

Cache files

Pattern What it ignores
*.slxc Cache files

Cloud based storage dotfile

Pattern What it ignores
.MATLABDriveTag Cloud based storage dotfile

How to use this .gitignore for MATLAB

  1. Copy the MATLAB rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Language .gitignore templates

See every Language template