git rebase: “error: cannot stat 'file': Permission denied”

后端 未结 30 2469
野趣味
野趣味 2020-12-02 04:56

I\'m using git, and made a small commit followed by a large one. I decided to use git rebase to squash the two commits together before pushing them. (I\'ve ne

30条回答
  •  不思量自难忘°
    2020-12-02 05:15

    When I see this on my machine, it's worse than just a "some process has the file open". The actual ownership of the file gets jacked up to the point where I (running as administrator) can only access it after rebooting.

    Nearest I can tell, IIS is part of the problem. If I switch between two major branches that require a lot of files to modify, git will delete a file or directory (usually DLLs) while IIS is trying to do something or another with it. At this point, the IIS process automatically overwrites the file on disk with a version that's locked and appears to be owned by nobody.

    Stopping IIS at this point doesn't do it. Best I've found out to do is to reboot, and remember to stop IIS before changing across major branches in the future.

    I know that doesn't really answer the question, but might be helpful to others.

提交回复
热议问题