简体   繁体   English

无法从ubuntu服务器上的git中提取最新代码

[英]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: 一些选项包括:

  • run the command as a user with permissions 以具有权限的用户身份运行命令
  • recursively change the ownership of the directory to give the 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.

相关问题 无法使用SSH密钥从远程服务器访问bitbucket,以对存储库中的最新代码执行git pull - Unable to access bitbucket from remote server using SSH key to perform a git pull on latest code in repository 无法从 Virtualbox 内的 Ubuntu 服务器上的 git 拉取 - Unable to pull from git on a Ubuntu Server inside of Virtualbox Git合并并拉不拉最新代码 - Git merge and pull not pulling the latest code 使用Git Pull覆盖本地文件| 丢弃所有本地文件和目录,并从存储库中搅拌完整的最新代码 - Override local files with Git Pull | Discard all local files and directories and git the complete latest code from the repo 无法从Git获取最新资源 - Failing to pull latest source from Git 从 git 中拉取最新版本的包 - Pull latest version of package from git 从git中获取最新的更改以获取特定的存储库 - Pull the latest changes from git for a specifc repository 使用netbeans支持的新git用户无法从远程存储库中提取最新提交 - new git user using netbeans support unable to pull latest commit from remote repository 无法git pull ubuntu [无法创建符号链接文件名太长] - Unable to git pull ubuntu [unable to create symlink Filename too long] 始终使用bower.json从git中获取最新版本的代码 - Always pull the latest version of code from git using bower.json
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM