By Björn Stiel, CTO at Zoomer Analytics (Dec 15, 2017)
By default, Git sees every file in your working directory. This has the ugly side effect that sooner or later you end up with a temporary Excel file under version control.
When you open your Excel workbook Book1.xlsb, Excel creates a temporary file called ~$Book1.xlsb. It should be automatically deleted after the workbook is correctly closed.
Though ~$Book1.xlsb is usually hidden, Git treats it like any other file, unless Git is explicitly instructed to ignore it. This is what .gitignore does: In .gitignore you can list path and file name (patterns) that you want Git to ignore.
Create a gitignore file
Create a file named .gitignore in the root folder of your repository’s working directory. Add the following conent to the .gitignore :
This ensures that Git ignores any file starting with ~$. For a full reference of valid patterns, see https://git-scm.com/docs/gitignore.
Add, commit and push .gitignore like any other file.