.gitignore for Microsoft Office
8 ignore rules for Microsoft Office, ready to copy into your repository.
Office suite
The complete .gitignore for Microsoft Office
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:31:33 UTC
# Technologies: Microsoft Office
### Microsoft Office ###
~$*.doc*
~$*.dot*
Backup of *.doc*
# Temporary files
*.tmp
~$*.xls*
*.xlk
~$*.ppt*
*.~vsd*
What these Microsoft Office rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Word temporary
| Pattern | What it ignores |
|---|---|
~$*.doc* |
Word temporary |
~$*.dot* |
Word temporary |
Word Auto Backup File
| Pattern | What it ignores |
|---|---|
Backup of *.doc* |
Word Auto Backup File |
General
| Pattern | What it ignores |
|---|---|
*.tmp |
Temporary files |
Excel temporary
| Pattern | What it ignores |
|---|---|
~$*.xls* |
Excel temporary |
Excel Backup File
| Pattern | What it ignores |
|---|---|
*.xlk |
Excel Backup File |
PowerPoint temporary
| Pattern | What it ignores |
|---|---|
~$*.ppt* |
PowerPoint temporary |
Visio autosave temporary files
| Pattern | What it ignores |
|---|---|
*.~vsd* |
Visio autosave temporary files |
How to use this .gitignore for Microsoft Office
- Copy the Microsoft Office rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.