尝试从 Xcode 推送到 GitHub 时发生卷曲错误
Curl error when trying to push from Xcode to GitHub
我在尝试将 GitHub 与我的 iOS Xcode 项目集成时遇到了麻烦。有些事情搞砸了,所以我决定从头开始。我正在使用 Xcode 版本 11.0。当我从 9.0 版本升级时,问题似乎又开始了。
我在 Xcode 中使用 SSH 密钥设置了 GitHub,但我也尝试过使用 HTTPS。
我使用 rm -rf .git
删除了现有的存储库。然后在 Xcode 中使用 Source Control / Create Git Repositories...
重新创建它们。
它按预期创建了本地存储库,我还在 GitHub 上创建了远程存储库。
但是,当我尝试 commit
或 push
时,出现以下错误:
如果我尝试 Fetch and Refresh Status
选项,我得到以下信息:
错误消息不是特别有启发性。我不确定接下来要尝试什么。我已经尝试在 GitHub 上手动创建远程存储库,并让 Xcode 创建它们,但我得到了相同的结果。我什至卸载并重新安装了 Curl。是否有明显的我应该做的事情,我可以检查的日志,或其他获取有关此信息的有用信息的方法?谢谢。
编辑:
以下是建议的 ssh 调用的结果。
Black-Mac-Pro:~ sheldon$ ssh -i ~/.ssh/id_github -Tv git@github.com
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Volumes/PEGASUS/Users/sheldon/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/id_github type 0
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/id_github-cert type -1
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem type -1
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version babeld-a81b9751
debug1: no match: babeld-a81b9751
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Volumes/PEGASUS/Users/sheldon/.ssh/known_hosts:4
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
debug1: Will attempt key: /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
debug1: Server accepts key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
Enter passphrase for key '/Volumes/PEGASUS/Users/sheldon/.ssh/id_github':
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.113.3]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_CA.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi lastmboy! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2684, received 2228 bytes, in 0.1 seconds
Bytes per second: sent 26179.5, received 21731.7
debug1: Exit status 1
Black-Mac-Pro:~ sheldon$ git ls-remote git@github.com:lastmboy/y2go.git
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
编辑(2019 年 10 月 10 日):
现在我得到以下信息:
Black-Mac-Pro:y2go sheldon$ ssh -i ~/.ssh/id_rsa git@github.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Volumes/PEGASUS/Users/sheldon/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Volumes/PEGASUS/Users/sheldon/.ssh/id_rsa": bad permissions
git@github.com: Permission denied (publickey).
如果您使用的是 SSH,则不应涉及 curl。
首先检查您的 SSH 密钥是否有效以及 GitHub 是否识别出您(意味着您已经在 GitHub 个人资料中注册了 public 密钥)
ssh -i ~/.ssh/id_github -Tv git@github.com
(假设您的 id_github
和 id_github.pub
文件位于 ~/.ssh/)
您应该会在最后看到一条欢迎消息。
如果不是,请使用 old PEM format:
重新创建密钥
ssh-keygen -t rsa -C "xxx@yyyy.com" -m PEM -P "" -f ~/.ssh/id_github2
然后检查远程 URL 是否存在:git ls-remote git@github.com:<YourGitHubAccount>/<YourRepo>
才能test XCode.
我在尝试将 GitHub 与我的 iOS Xcode 项目集成时遇到了麻烦。有些事情搞砸了,所以我决定从头开始。我正在使用 Xcode 版本 11.0。当我从 9.0 版本升级时,问题似乎又开始了。
我在 Xcode 中使用 SSH 密钥设置了 GitHub,但我也尝试过使用 HTTPS。
我使用 rm -rf .git
删除了现有的存储库。然后在 Xcode 中使用 Source Control / Create Git Repositories...
重新创建它们。
它按预期创建了本地存储库,我还在 GitHub 上创建了远程存储库。
但是,当我尝试 commit
或 push
时,出现以下错误:
如果我尝试 Fetch and Refresh Status
选项,我得到以下信息:
错误消息不是特别有启发性。我不确定接下来要尝试什么。我已经尝试在 GitHub 上手动创建远程存储库,并让 Xcode 创建它们,但我得到了相同的结果。我什至卸载并重新安装了 Curl。是否有明显的我应该做的事情,我可以检查的日志,或其他获取有关此信息的有用信息的方法?谢谢。
编辑: 以下是建议的 ssh 调用的结果。
Black-Mac-Pro:~ sheldon$ ssh -i ~/.ssh/id_github -Tv git@github.com
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Volumes/PEGASUS/Users/sheldon/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com port 22.
debug1: Connection established.
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/id_github type 0
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/id_github-cert type -1
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem type -1
debug1: identity file /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version babeld-a81b9751
debug1: no match: babeld-a81b9751
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Volumes/PEGASUS/Users/sheldon/.ssh/known_hosts:4
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
debug1: Will attempt key: /Volumes/PEGASUS/Users/sheldon/.ssh/Y2goAWS.pem explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
debug1: Server accepts key: /Volumes/PEGASUS/Users/sheldon/.ssh/id_github RSA SHA256:urvuR2AnjonUD93eMeBsznrm+e/C0u3kDAiFGFFHT2U explicit
Enter passphrase for key '/Volumes/PEGASUS/Users/sheldon/.ssh/id_github':
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.113.3]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_CA.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi lastmboy! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2684, received 2228 bytes, in 0.1 seconds
Bytes per second: sent 26179.5, received 21731.7
debug1: Exit status 1
Black-Mac-Pro:~ sheldon$ git ls-remote git@github.com:lastmboy/y2go.git
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
编辑(2019 年 10 月 10 日):
现在我得到以下信息:
Black-Mac-Pro:y2go sheldon$ ssh -i ~/.ssh/id_rsa git@github.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Volumes/PEGASUS/Users/sheldon/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Volumes/PEGASUS/Users/sheldon/.ssh/id_rsa": bad permissions
git@github.com: Permission denied (publickey).
如果您使用的是 SSH,则不应涉及 curl。
首先检查您的 SSH 密钥是否有效以及 GitHub 是否识别出您(意味着您已经在 GitHub 个人资料中注册了 public 密钥)
ssh -i ~/.ssh/id_github -Tv git@github.com
(假设您的 id_github
和 id_github.pub
文件位于 ~/.ssh/)
您应该会在最后看到一条欢迎消息。
如果不是,请使用 old PEM format:
重新创建密钥ssh-keygen -t rsa -C "xxx@yyyy.com" -m PEM -P "" -f ~/.ssh/id_github2
然后检查远程 URL 是否存在:git ls-remote git@github.com:<YourGitHubAccount>/<YourRepo>
才能test XCode.