我正在开发一个 ASP.NET MVC 应用程序,但在部署它时遇到了困难。当我发出命令
git add .
时,出现以下错误:
git : error: open(".vs/DonationSite/FileContentIndex/56f14db3-4306-4df1-bad7-f487ea83802a.vsidx"): Permission denied
At line:1 character:1
+ git add .
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (error: open(".v...rmission denied:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
error: unable to index file
'.vs/DonationSite/FileContentIndex/56f14db3-4306-4df1-bad7-f487ea83802a.vsidx'
fatal: adding files failed
我已经尝试将
.gitignore
移动到根文件夹,但没有成功
如果您尝试从以下文件夹推送代码
你会遇到这个问题。
error: open(".vs/GitPush/FileContentIndex/c1f9f8f4-a85c-479e-a361-e9906066bc97.vsidx"): Permission denied
error: unable to index file '.vs/GitPush/FileContentIndex/c1f9f8f4-a85c-479e-a361-e9906066bc97.vsidx'
fatal: adding files failed
.vs
=> GitPush
=> FileContentIndex
,您将找到扩展名为 .vsidx
的文件。现在运行命令
git add .
。
运行以下命令来完成任务。
git init
git add README.md
git commit -m "Commit after add"
git branch -M main
git remote add origin https://github.com/HarshithaVeeramalla/GitHubRepo.git
git push -u origin main