【问题标题】:Cannot Git push on remote server via ssh无法通过 ssh 在远程服务器上进行 Git 推送
【发布时间】:2014-10-29 07:26:12
【问题描述】:

您好,我是 Git 新手,在远程服务器上推送提交时遇到问题。这是我的设置

远程服务器

我在 /var/www/html/bare 上有一个裸存储库 git init --bare --shared

在我的电脑中

我设置:

git remote add origin ssh://username@hostname:22/var/www/html/bare

每当我制作时:

git push origin master

我遇到了一些权限错误,它无法推送到我的远程服务器

我试过了:

chmod -R 755 。在我的远程裸仓库上,但不起作用。我也在网上看 问题仍然存在。

我错过了什么吗?

错误

remote : error : insufficient permission for adding an object to repository database objectsW
fatal: sha1 file '<stdout>' write error : Invalid argument
error: failed to push some refs to 'ssh://user@hostname:22/var/www/html/bare'

谢谢!

【问题讨论】:

  • 请添加你得到的权限错误
  • remote : 错误 : 将对象添加到存储库数据库 objectsW 的权限不足致命:sha1 文件'' 写入错误:无效参数错误:无法将一些参考推送到'ssh://user @hostname:22/var/www/html/bare'

标签: git ssh remote-server


【解决方案1】:

ssh user@host "git init --bare /mnt/infy/bar/my-project.git"

也请参考链接,

http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes

【讨论】:

  • 我也看过这个,但没有帮助。谢谢!
猜你喜欢
  • 2017-02-15
  • 1970-01-01
  • 2013-03-10
  • 1970-01-01
  • 1970-01-01
  • 2022-07-14
  • 1970-01-01
  • 2013-11-22
  • 1970-01-01
相关资源
最近更新 更多