我的目标是通过git在生产群集内的三个节点上部署新版本。不幸的是,我现在已经纠正了访问权限的问题。现在我坚持认为git认为一切都是最新的消息。
@node1:/home/www/test$ git remote -v
production ssh://fx1/home/git/test.git (fetch)
production ssh://fx2/home/git/test.git (push)
production ssh://fx3/home/git/test.git (push)
production ssh://fx1/home/git/test.git (push)
做完git push制作后我得到了
...
Writing objects: 100% (7339/7339), 18.44 MiB | 1.11 MiB/s, done.
Total 7339 (delta 2262), reused 7077 (delta 2100)
remote: error: unable to create file .gitattributes (Permission denied)
remote: error: unable to create file .gitignore (Permission denied)
remote: error: unable to create file .gitmodules (Permission denied)
remote: error: cannot create submodule directory MEW
remote: error: unable to create file act_adv_jump.php (Permission denied)
remote: error: unable to create file act_unsubscribe_newsletter.php (Permission denied)
remote: fatal: cannot create directory at 'app_cron': Permission denied
To ssh://fx1/home/git/test.git
* [new branch] master -> master
现在我意识到组用户没有对钩子所在的destintion目录的写权限。我添加了g + w并尝试再次推送:
@node1:/home/www/test$ git push production
Everything up-to-date
Everything up-to-date
Everything up-to-date
如何重置生产服务器git repo以便再次推送?
答案 0 :(得分:1)
一种解决方案是添加新提交(即使是空git commit --allow-empty
提交)并再次推送。
这比修改当前的HEAD(git commit --amend --no-edit
)和git push --force
要好。