Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop git from tracking temporary open Microsoft Office files

Tags:

git

gitignore

Microsoft Office makes copies of open files, say when you open abc.xlsx Excel creates a file called ~$abc.xlsx, prefaced with a tilde and dollar sign.

When I open an Excel file in my git repository to look at the data, git tracks the new file as a change and I have to take care to avoid committing it. How can I use a .gitignore file to skip tracking these files?

like image 311
Sam Firke Avatar asked Oct 23 '25 19:10

Sam Firke


1 Answers

Add a new row to your .gitignore file containing ~$*. That will ignore any files beginning with ~$, the prefix for temporary Microsoft Office files.

like image 122
Sam Firke Avatar answered Oct 25 '25 09:10

Sam Firke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!