0

When I run git add .

Then the following message:

error: open("~$myfile.pptx"): Permission denied

error: unable to index file ~$myfile.pptx

fatal: adding files failed

So I run Icacls myfile.pptx /grant user:(F,WD)

But still error.

How to change the rigth permission?

Community
  • 1
  • 1
Jonathan Cheng
  • 459
  • 2
  • 11
  • 26
  • 1
    `~$myfile.pptx` != `myfile.pptx`. One might be a temporary file with a lock? In other words, don't `git add .` but try adding only the specific file. – crashmstr Apr 27 '17 at 14:42

1 Answers1

1

~$myfile.pptx is a separate file from your powerpoint file myfile.pptx. Those are temporary files created by powerpoint while you have the original open.

It is safe for git to ignore those files. Create a .gitignore file at the base of your project or add this line to it.

~$*

At which git status shouldn't show that file anymore and git add . won't try to commit it any longer.

Also, here is a widely used .gitignore file for MS office files

Community
  • 1
  • 1
castis
  • 8,154
  • 4
  • 41
  • 63