windows - 如何在没有加密密钥的情况下禁用 8.1 中的锁定文件
问题描述
我删除了具有 .git 文件夹的统一项目并要求我创建一个加密密钥我不知道为什么它要求我这样做,现在当我尝试在 git 中添加文件时它拒绝添加任何东西并提示这个错误
The file will have its original line endings in your working directory
error: open("Temp/UnityLockfile"): Permission denied
error: unable to index file 'Temp/UnityLockfile'
fatal: adding files failed
任何建议
解决方案
In general the Temp
folder is one of the things you do NOT want to be under version control! It should be ignored as mentioned by the first comment! Use this .gitignore
file in the root folder of your git project!
Also see Cleaning up and Migrating existing Unity project into new one or another PC where I explained it a bit more in detail and also how to copy your project with only the necessary files.
As said if there is no such file yet simply create it, otherwise adopt the content accordingly.
Also refer to How can I make Git "forget" about a file that was tracked, but is now in .gitignore?.
In your specific case here the error itself is caused because you currently have your project opened in Unity.
In that case there is the - as the name says - LOCK file which ensures you cannot open the same project twice in a second Unity instance.
This file is locked/owned by the Unity Editor process itself and therefore can't be overwritten/accessed by git at the same time.
Now if for some reason after adding the .gitignore
file mentioned above this issue still persists you can close Unity, manually delete the Temp folder, make your git merge and reopen Unity.
推荐阅读
- python - 安装 scikit-image 包时 anaconda 中的 InvalidArchiveError
- javascript - 将当前时间与 ngb-timepicker 中输入的时间进行比较
- python - 尝试访问 Binance API 时出错:“Binance”对象没有属性“binance_keys”
- android - 如何从字符串文件(getResources)android中获取TabLayout的名称
- php - 语法错误,意外 ')',期待 '[' (查看:C:\project\laravel\project1\app\resources\views\products.blade.php)
- python - 如何使用 Tensorflow Federated 中的多个功能构建模型?
- c# - 是否可以为一组属性值创建一个单独的序列?
- sql - SQL - 根据时间戳删除重复项
- java - UnsatisfiedDependencyException when creating MongoTemplate bean
- google-apps-script - 让谷歌表格脚本重复多个数据然后清除单元格的问题