我试图找出为什么在我尝试部署我的 Rails 应用程序时从我的远程 git 存储库中收到错误。它告诉我它不是 git 存储库,但我可以毫无问题地从中推送和 pull 。但是,我最近遇到了 bash 找不到 git 的问题,但这只是我安装 macports 时突然出现的路径变量问题(我认为)。现在已经修好了。在此先感谢您提供的任何帮助! 错误输出如下:
my-MacBook-Pro:project myUser$ cap deploy:update
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@server.example.ca/usr/local/git_root/project.git master"
fatal: 'git@server.example.ca/usr/local/git_root/project.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
* executing "rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true"
servers: ["project.example.ca"]
[project.example.ca] executing command
[project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290@project' -c 'rm -rf /usr/local/www/sites/project.example.ca/releases/20120403193900; true'
command finished in 639ms
Command git ls-remote git@server.example.ca/usr/local/git_root/project.git master returned status code pid 1815 exit 128
最佳答案
看起来你的 Git URL 格式不正确:
git ls-remote git@server.example.ca/usr/local/git_root/project.git master
应该是:
git ls-remote git@server.example.ca:/usr/local/git_root/project.git master
它们遵循 SCP 协议(protocol)(更多信息请参见 git-clone 联机帮助页)。
关于ruby-on-rails - 在使用 capistrano 进行 rails 部署期间无法识别 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10000489/