Bitbucket:Cygwin上的Git - 无法推送到远程存储库

时间:2013-02-12 01:10:44

标签: git cygwin bitbucket git-push

更新了x3(见下文) 所以我成功使用我的Git Bitbucket回购数月,直到 12年11月29日。直到前一天(2013年1月24日)我才尝试再做一次提交 徒劳无功。我在Cygwin重新安装了我的ssh服务器,所以我保证我有一个合适的 连接。我可以从另一个工作站访问我的服务器,所以我 确定没关系。我也能够克隆我的回购,没有任何问题 Bitbucket使用ssh隧道。但是,当我试图推动我的改变 (在添加,提交等之后)我得到以下内容:

$ git push origin master    
Enter passphrase for key '/home/[User]/.ssh/id_rsa':    
conq: invalid command syntax.    
fatal: The remote end hung up unexpectedly

我搜索了论坛,常见问题解答等无济于事。这是输出 我的ssh:

$ ssh -T git@bitbucket.org
Enter passphrase for key '/home/[User]/.ssh/id_rsa':
conq: logged in as [username].

您可以使用git或hg连接到Bitbucket。 Shell访问被禁用。

而且,对于ssh -v:

$ ssh -v
OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-e escape_char] [-F configfile]
[-I pkcs11] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-R [bind_address:]port:host:hostport] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]]
[user@]hostname [command]

和git --version:

$ git --version
git version 1.7.5.1

正如我所说,ssh似乎正在发挥作用,这看起来像是其他东西。

- Update-- 以下是ssh -v -T git@bitbucket.org

的输出
$ ssh -v -T git@bitbucket.org
OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to bitbucket.org [207.223.240.181] port 22.
debug1: Connection established.
debug1: identity file /home/[User]/.ssh/id_rsa type 1
debug1: identity file /home/[User]/.ssh/id_rsa-cert type -1
debug1: identity file /home/[User]/.ssh/id_dsa type -1
debug1: identity file /home/[User]/.ssh/id_dsa-cert type -1
debug1: identity file /home/[User]/.ssh/id_ecdsa type -1
debug1: identity file /home/[User]/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /home/[User]/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/[User]/.ssh/id_rsa
debug1: Remote: Forced command: conq username:[username]
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/[User]/.ssh/id_rsa':
debug1: read PEM private key done: type RSA
debug1: Remote: Forced command: conq username:[username]
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([207.223.240.181]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
conq: logged in as [username].

You can use git or hg to connect to Bitbucket. Shell access is disabled.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2576, received 2984 bytes, in 0.3 seconds
Bytes per second: sent 7759.0, received 8988.0
debug1: Exit status 0

更新(2013年2月17日):我搜索了Bitbucket网站上的支持页面,但他们只详细介绍了如何在Windows上使用GitBash设置Bitbucket而不是Cygwin。我看到其他人在他们的常见问题解答中遇到了同样的问题,但被提到了Atlassian的支持。

我开始直接与Atlassian支持人员交谈,然后那个人告诉我查看Stack Overflow上的帖子(Git with SSH on Windows)。发布的解决方案不起作用,因此支持代表指示我安装GitBash以查看除了Cygwin之外是否还有其他问题。我安装了GitBash并且能够使其工作,并且可以使用ssh或https再次推送和克隆。我告诉代表,他说,因为我的问题是我自己的软件,所以他可以提供帮助。所以我相信我已经把问题缩小到了Cygwin中的某个机制,这个机制似乎与SSH无关,但也许与git有关。

更新(2013年2月18日): 今天,我确认我也能从Cygwin中撤出。所以现在,我只是推出了问题。我正在考虑在Errors cloning git project using Cygwin, msysgit Bash shell works中将一个别名映射到Cygwin内部的mysysgit,但这可能比我现在要花费的时间要多。仍在寻找让Git在Cygwin中本地工作的解决方案。

更新(2013年2月20日): 我现在使用GitBash推送完全相同的错误。请在支持页面查看此垃圾:https://bitbucket.org/site/master/issue/4406/invalid-command-synthax

这似乎是一个反复出现的问题,他们的支持不会直接解决。从它的外观来看,这一直是自2012年6月以来一直没有公布的决议。如果有人读到这个并且可以给我一些方向,我会非常感激。目前,我已使用HTTPS切换到GitBash。

4 个答案:

答案 0 :(得分:3)

请检查{project_folder}/.git/config文件。 如果有远程存储库URL ssh://。删除它并尝试按下操作。

git push -u origin --all

有效的远程存储库网址

url = git@bitbucket.org:{username}/{project-name}.git

答案 1 :(得分:1)

https://bitbucket.org/site/master/issue/4218/conq-invalid-repository-syntax

“对于SSH问题,请先在https://confluence.atlassian.com/display/BITBUCKET/Troubleshooting+SSH+Issues尝试我们的问题排查指南。如果您仍然遇到问题,请将其提交至support@bitbucket.org或http://answers.atlassian.com,其中支持人员或社区可以帮助解决配置方面的任何问题。“

答案 2 :(得分:0)

此问题已修复。这是由于一些客户端具有唯一设置的receivepack配置。虽然我不知道客户决定设置这个,但是很多用户都受到了影响,因为Bitbucket的系统并不是设计用于通过SSH处理非连字符git命令语法。 Bitbucket现在已将此更改为允许git-receive-pack和git receive-pack工作。

作为参考,请检查您的全局配置,您可能会看到类似的内容:

remote.origin.receivepack git receive-pack

默认情况下,未设置,但默认值为git-receive-pack

答案 3 :(得分:0)

我按照此博文中的说明进行操作:

http://blog.cyplo.net/2012/10/25/using-git-in-cygwin-with-bitbucketgithubother-key-reliant-service/

在我将.ssh文件夹的组从None更改为Users

后,它工作正常

chown abudaan:用户.ssh -R