Capistrano和Git工作正常,直到我将我的网站移动到另一台服务器。由于SSH已知主机相关的问题,我的第一次部署尝试出错了。
即使我设法解决了这个问题,另一个问题也引发了,我再也无法部署了:
* executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' updating the cached checkout on all servers executing locally: "git ls-remote collimarco@mywebsite.com:/home/collimarco/git/foto-fiori.git master" * executing "if [ -d /home/collimarco/mywebsite.com/shared/cached-copy ]; then cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e; else 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 deploy 7de27a6a1de7a94508f943596413e5e0f217f57e; fi" servers: ["mywebsite.com"] [mywebsite.com] executing command ** [mywebsite.com :: out] * refusing to create funny ref 'remotes/origin/*' locally ** [mywebsite.com :: out] collimarco@mywebsite.com's password: Password: ** [mywebsite.com :: out] ** [mywebsite.com :: out] fatal: Needed a single revision command finished *** [deploy:update_code] rolling back * executing "rm -rf /home/collimarco/mywebsite.com/releases/20091027191027; true" servers: ["mywebsite.com"] [mywebsite.com] executing command command finished failed: "sh -c \"if [ -d /home/collimarco/mywebsite.com/shared/cached-copy ]; then cd /home/collimarco/mywebsite.com/shared/cached-copy && git fetch origin && git reset --hard 7de27a6a1de7a94508f943596413e5e0f217f57e; else 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 deploy 7de27a6a1de7a94508f943596413e5e0f217f57e; fi\"" on mywebsite.com
我的git存储库似乎完好无损:为什么我会得到“需要一个修订版”?
非常感谢任何建议。 提前谢谢!
更新:有人建议删除远程缓存,我该怎么做?
更新:我已将shared / cached-copy重命名为shared / cached-copy-old。 然后我创建了一个共享/缓存副本空文件夹。 现在我得到“Not a git repository”: http://pastie.org/672254.txt
答案 0 :(得分:3)
检查客户端和服务器上的git版本;我打赌你需要将其中一个更新为1.6。