我在Lion机器上有这个应用程序,它位于一个多变量存储库中,所以我使用hg-git将它部署到heroku。
〜/ .hgrc
[extensions]
hgext.bookmarks =
hggit =
... /项目/ .hg / hgrc
[paths]
default = https://validhgrepo.com
[alias]
push-heroku = push git+ssh://git@heroku.com:appname.git
然后当我运行hg push-heroku它应该部署,但我得到:
caseys-MacBook-Air:project casey$ hg push-heroku
pushing to git+ssh://git@heroku.com:appname.git/
creating and sending data
["git-receive-pack 'appname.git/'"]
! Invalid path.
! Syntax is: git@heroku.com:<app>.git where <app> is your app's name.
abort: git remote error: The remote server unexpectedly closed the connection.
这没有任何意义。我觉得错误信息是误导性的,因为该存储库存在。
这也适用于我的ubuntu机器,具有类似的设置。
答案 0 :(得分:2)
原来这与此issue有关。我之前没有注意到额外的斜线。我应用了一个与此guy类似的补丁,它适用于我(最新的hg,hg-git和osx)。
如何安装补丁的详细信息:
首先将其卸载
sudo easy_install -m 'hg-git'
然后删除〜/ Library / Python / 2.7 / site-packages中的hg-git egg文件
安装为目录
sudo easy_install -Z 'hg-git'
打开〜/ Library / Python / 2.7 / site-packages / hg_git .... / hggit / git_handler.py
手工贴补丁(我的更像是1118号线)
--- git_handler.py Thu Jul 28 22:05:45 2011
+++ patched.git_handler.py Thu Jul 28 22:11:44 2011
@@ -1066,6 +1066,8 @@
port = None
host, path = hostpath.split(hostpath_seper, 1)
+ if (host.find('heroku') > 0):
+ path = path.rstrip('/')
if hostpath_seper == '/':
transportpath = '/' + path
else:
答案 1 :(得分:-2)
你的git远程格式搞砸了。
在.git / config中,确保您的遥控器采用以下格式:
git@heroku.com:appname.git
其中appname
是Heroku上的应用程序名称