git pull 报错unable to append to ‘.git/logs/HEAD‘: Permission denied

在执行gitpull时遇到致命错误:无法更新HEAD引用,详细报错信息是无法追加到.git/logs/HEAD,权限被拒绝。解决方法是更改当前仓库下.git/logs/HEAD文件的权限,使用命令chmod666.git/logs/HEAD赋予读写权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

git pull的时候报错:
fatal: update_ref failed for ref 'HEAD': cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Permission denied

【解决】

根据上述报错的.git/logs/HEAD ,修改当前库下的git文件权限:

chmod 666 .git/logs/HEAD

INFO 08-11 15:10:56 [__init__.py:235] Automatically detected platform cuda. ERROR 08-11 15:10:58 [registry.py:396] Error in inspecting model architecture 'Qwen3ForCausalLM' ERROR 08-11 15:10:58 [registry.py:396] Traceback (most recent call last): ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 394, in _try_inspect_model_cls ERROR 08-11 15:10:58 [registry.py:396] return model.inspect_model_cls() ERROR 08-11 15:10:58 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 365, in inspect_model_cls ERROR 08-11 15:10:58 [registry.py:396] return _run_in_subprocess( ERROR 08-11 15:10:58 [registry.py:396] ^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 666, in _run_in_subprocess ERROR 08-11 15:10:58 [registry.py:396] returned = subprocess.run(_SUBPROCESS_COMMAND, ERROR 08-11 15:10:58 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 548, in run ERROR 08-11 15:10:58 [registry.py:396] with Popen(*popenargs, **kwargs) as process: ERROR 08-11 15:10:58 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 1026, in __init__ ERROR 08-11 15:10:58 [registry.py:396] self._execute_child(args, executable, preexec_fn, close_fds, ERROR 08-11 15:10:58 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 1950, in _execute_child ERROR 08-11 15:10:58 [registry.py:396] raise child_exception_type(errno_num, err_msg, err_filename) ERROR 08-11 15:10:58 [registry.py:396] PermissionError: [Errno 13] Permission denied: '' ERROR 08-11 15:10:59 [registry.py:396] Error in inspecting model architecture 'TransformersForCausalLM' ERROR 08-11 15:10:59 [registry.py:396] Traceback (most recent call last): ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 394, in _try_inspect_model_cls ERROR 08-11 15:10:59 [registry.py:396] return model.inspect_model_cls() ERROR 08-11 15:10:59 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 365, in inspect_model_cls ERROR 08-11 15:10:59 [registry.py:396] return _run_in_subprocess( ERROR 08-11 15:10:59 [registry.py:396] ^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/model_executor/models/registry.py", line 666, in _run_in_subprocess ERROR 08-11 15:10:59 [registry.py:396] returned = subprocess.run(_SUBPROCESS_COMMAND, ERROR 08-11 15:10:59 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 548, in run ERROR 08-11 15:10:59 [registry.py:396] with Popen(*popenargs, **kwargs) as process: ERROR 08-11 15:10:59 [registry.py:396] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 1026, in __init__ ERROR 08-11 15:10:59 [registry.py:396] self._execute_child(args, executable, preexec_fn, close_fds, ERROR 08-11 15:10:59 [registry.py:396] File "/home/mxf/anaconda3/lib/python3.11/subprocess.py", line 1950, in _execute_child ERROR 08-11 15:10:59 [registry.py:396] raise child_exception_type(errno_num, err_msg, err_filename) ERROR 08-11 15:10:59 [registry.py:396] PermissionError: [Errno 13] Permission denied: '' Traceback (most recent call last): File "/mnt/e/QWEN/demo_vllm.py", line 9, in <module> llm = LLM(model="./qwen3-1.7b") ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/entrypoints/llm.py", line 273, in __init__ self.llm_engine = LLMEngine.from_engine_args( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 490, in from_engine_args vllm_config = engine_args.create_engine_config(usage_context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/engine/arg_utils.py", line 1004, in create_engine_config model_config = self.create_model_config() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mxf/anaconda3/lib/python3.11/site-packages/vllm/engine/arg_utils.py", line 872, in create_model_config return ModelConfig( ^^^^^^^^^^^^ File "/home/mxf/anaconda3/lib/python3.11/site-packages/pydantic/_internal/_dataclasses.py", line 123, in __init__ s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s) pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelConfig Value error, Model architectures ['Qwen3ForCausalLM', 'TransformersForCausalLM'] failed to be inspected. Please check the logs for more details. [type=value_error, input_value=ArgsKwargs((), {'model': ...attention_dtype': None}), input_type=ArgsKwargs] For further information visit https://errors.pydantic.dev/2.11/v/value_error 该错误怎么解决
最新发布
08-12
### Git操作中遇到的权限问题解决方案 当执行`git pull`命令时报错 `error: cannot open .git/FETCH_HEAD: Permission denied`,这通常意味着当前用户对于`.git/FETCH_HEAD`文件缺乏写入权限[^1]。 #### 方法一:更改目录权限 可以通过修改.git及其子文件夹和文件的权限来解决问题。使用以下命令调整整个仓库以及其内部所有项目的访问权限: ```bash chmod -R 755 /path/to/your/repo ``` 此方法适用于大多数情况下的权限不足错误[^2]。 #### 方法二:改变所有权 如果项目位于共享环境中,则可能需要将存储库的所有权更改为当前登录用户: ```bash sudo chown -R $USER:$USER /path/to/your/repo ``` 这条指令会把指定路径下所有的文件都变更为当前用户的拥有者身份,从而允许对该位置内的资源进行读取与编辑操作。 #### 方法三:检查全局配置 有时也会因为Git本身的设置不当而引发此类异常现象。可以尝试重置一些基本参数至默认状态看看是否有改善效果: ```bash git config --global --unset core.sharedRepository ``` 上述命令能够移除任何可能导致冲突性的自定义属性设定,恢复到较为安全稳定的初始模式运行环境之中。 #### 方法四:克隆新副本 作为最后手段,在不影响工作进度的前提下考虑重新下载一份完整的源码拷贝也是不错的选择之一。先备份好本地改动部分再做决定是否要采取这种方式处理现有难题。 ```bash cd .. rm -rf your-repo-name/ git clone https://github.com/user/repo.git ``` 以上几种方式都可以有效应对由于权限不够所造成的无法打开 FETCH_HEAD 文件的情况,请依据实际情况选取最合适的办法加以实施。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值