我是GitHub的新手.今天我在尝试将代码推送到GitHub时遇到了一些问题.
Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@github.com:519ebayproject/519ebayproject.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:519ebayproject/519ebayproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
我还没有在存储库中推送任何东西,为什么我需要拉东西呢?
我目前在公共WIFI上,我无法使用SSH(他们可能阻止了该端口).但是,我需要连接来做一个git push.
? ssh -T git@github.com
ssh: connect to host github.com port 22: Connection refused
Run Code Online (Sandbox Code Playgroud)
是否可以通过端口80设置SSH隧道并告诉github push使用该连接来绕过此限制?怎么做?我在OSX(狮子).这一定是个常见问题吗?
在过去的几天里,我一直无法推送到远程(gitlab),它在此之前一直有效。我知道这个问题有 10 个类似的问题,也许答案就在其中的某个地方。然而,我一直在尝试许多建议的解决方案 - 但徒劳。
当我推动时,我得到:
ssh: connect to host gitlab.com port 22: Connection refused
fatal: The remote end hung up unexpectedly
本地位于宪法服务器上,这里的许多人都使用端口 22 主要用于 github,没有任何问题。这是否可能是我这边的防火墙设置可能与 gitlab 特别相关?管理员确保这不是简单的白名单问题。
我的 gitlab 网址如下:
origin git@gitlab.com:myname/myproject.git (fetch)
origin git@gitlab.com:myname/myproject.git (push)
我尝试使用替代的 ssh 格式更新 git-url:
origin ssh://git@gitlab.com/myname/myproject.git (fetch)
origin ssh://git@gitlab.com/myname/myproject.git (push)
我已经尝试了端口 22 和替代端口 443 - 这是文件~/.ssh/config:
Host gitlab.com
RSAAuthentication yes
IdentityFile ~/.ssh/id_rsa
选择:
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
我尝试过使用 https 连接(徒劳)。
制作了新的 ssh 密钥(徒劳)。 …