【问题标题】:Capistrano & Git: Needed a single revisionCapistrano 和 Git:需要一次修订
【发布时间】:2010-12-10 15:02:56
【问题描述】:

Capistrano 和 Git 正常工作,直到我将我的网站移动到另一台服务器。由于与 SSH-known-hosts 相关的问题,我的第一次部署尝试出错了。

即使我设法解决了这个问题,另一个问题也提出了,我无法再部署:

* 执行“部署” * 执行“部署:更新” ** 交易:开始 * 执行`deploy:update_code' 更新所有服务器上的缓存结帐 在本地执行:“git ls-remote collimarco@mywebsite.com:/home/collimarco/git/foto-fiori.git master” * 执行 "if [ -d /home/collimarco/mywebsite.com/shared/cached-copy ]; 然后 cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e ; 否则 git clone --depth 1 collimarco@mywebsite.com:/home/collimarco/git/foto-fiori.git /home/collimarco/mywebsite.com/shared/cached-copy && cd /home/collimarco/mywebsite.com /shared/cached-copy && git checkout -b 部署 7de27a6a1de7a94508f943596413e5e0f217f57e;fi" 服务器:[“mywebsite.com”] [mywebsite.com] 执行命令 ** [mywebsite.com :: out] * 拒绝在本地创建有趣的 ref 'remotes/origin/*' ** [mywebsite.com :: out] collimarco@mywebsite.com 的密码: 密码: ** [mywebsite.com :: out] ** [mywebsite.com :: out] 致命:需要单个修订 命令完成 *** [deploy:update_code] 回滚 * 执行“rm -rf /home/collimarco/mywebsite.com/releases/20091027191027; true” 服务器:[“mywebsite.com”] [mywebsite.com] 执行命令 命令完成 失败:“sh -c \”如果 [ -d /home/collimarco/mywebsite.com/shared/cached-copy ];然后 cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e;否则 git clone --depth 1 collimarco@mywebsite.com:/home/collimarco/git/foto-fiori.git /home/collimarco/mywebsite.com/shared/cached-copy && cd /home/collimarco/mywebsite.com/共享/缓存复制 && git checkout -b deploy 7de27a6a1de7a94508f943596413e5e0f217f57e;在 mywebsite.com 上的 fi\""

我的 git 存储库似乎完好无损:为什么我会收到“需要一个修订版”?

非常感谢任何建议。 提前致谢!

更新:有人建议删除远程缓存,我该怎么做?

更新:我已将 shared/cached-copy 重命名为 shared/cached-copy-old。 然后我创建了一个共享/缓存副本空文件夹。 现在我得到“不是 git 存储库”: http://pastie.org/672254.txt

【问题讨论】:

  • 您是否更新了 deploy.rb 文件,我想您已经更新了,但您介意发布相关信息吗?您使用的是哪个版本的 capistrano?
  • 我使用 Capistrano v2.5.2 并更新了 deploy.rb ;)
  • 只需删除共享/缓存副本。不要更换,帽子会替你做的。

标签: ruby-on-rails git deployment capistrano


【解决方案1】:

在客户端和服务器上检查你的 git 版本;我打赌你需要将其中一个更新到 1.6。

【讨论】:

  • 我的本地版本是1.6.4.1,而服务器上的版本是1.4.4.4。我使用我使用 Capistrano v2.5.2。是不是这个问题?即使我在本地机器上成功使用了“git push”?
  • 是的,存在与 1.6.x 和 1.4.x 的 ref 不兼容。更新服务器。
猜你喜欢
  • 2014-11-28
  • 2011-06-15
  • 1970-01-01
  • 2011-07-31
  • 1970-01-01
  • 2012-01-04
  • 2021-07-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多