[英]Unable to pull latest code from git on ubuntu server
I'm trying to pull changes from my git branch onto an Ubuntu server. 我正在尝试将git分支中的更改拉到Ubuntu服务器上。 For some reason, I'm getting this error when trying to pull:
由于某些原因,尝试拉时出现此错误:
ubuntu@ip-xxx-xx-xx-xx:/var/www/html/prod/dist$ git pull
Username for 'https://github.com': my_name
Password for 'https://my_name@github.com':
remote: Counting objects: 1082, done.
remote: Compressing objects: 100% (96/96), done.
fatal: Unable to create temporary file '/var/www/html/prod/dist/.git/objects/pack/tmp_pack_XXXXXX': Permission denied
fatal: index-pack failed
Any thoughts on why this is occuring? 为什么会这样呢? Thanks in advance.
提前致谢。
The user you're executing the command as ( ubuntu
judging from your prompt), doesn't have permission to create the temporary file in question. 您以(
ubuntu
从您的提示判断)执行命令的用户无权创建相关的临时文件。
You can inspect the current permissions of the pack
directory by running the following command: 您可以通过运行以下命令来检查
pack
目录的当前权限:
$ ls -ld .git/objects/pack
drwxr-xr-x 2 chuckx chuckx 4096 May 28 22:51 .git/objects/pack
Based on the results you can decide what to do. 根据结果,您可以决定要做什么。 Some options include:
一些选项包括:
ubuntu
user permission to write (ie chown -R ubuntu .git
ubuntu
用户写权限(即chown -R ubuntu .git
Looks like you have permission problems locally to write inside /var/www/html/prod/dist/.git/ . 好像您在本地在/var/www/html/prod/dist/.git/中编写权限问题。 Check that you are using a user that has RW access over there.
检查您使用的是那里具有RW访问权限的用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.