Github:无法使用远程URL类型https获取最后一次提交,但是使用ssh可以

时间:2016-10-28 19:35:12

标签: git github ssh

我将提交从系统A推送到github.com,但无法在系统B上提取,收到消息"已经是最新的。"。但是,当我使用ssh架构更改远程URL时,我可以提取提交:

$ git pull
Already up-to-date.
$ git remote -v
origin  https://github.com/identinetics/saml2test2 (fetch)
origin  https://github.com/identinetics/saml2test2 (push)
$ git remote set-url origin git@github.com:identinetics/docker-saml2test2.git
$ git fetch
warning: no common commits
remote: Counting objects: 949, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 949 (delta 32), reused 0 (delta 0), pack-reused 892
Receiving objects: 100% (949/949), 4.53 MiB | 1.57 MiB/s, done.
Resolving deltas: 100% (282/282), done.
From github.com:identinetics/docker-saml2test2
 + 2946d92...27e6f9a master     -> origin/master  (forced update)

$ git remote set-url origin https://github.com/identinetics/saml2test2 
$ git fetch
From https://github.com/identinetics/saml2test2
 + 27e6f9a...2946d92 master     -> origin/master  (forced update)
$ git remote set-url origin git@github.com:identinetics/docker-saml2test2.git
$ git fetch
From github.com:identinetics/docker-saml2test2
 + 2946d92...27e6f9a master     -> origin/master  (forced update)

我对此系统上的ssh没有任何问题,但我想了解这个问题,因为其他目标系统位于阻止ssh的防火墙后面。

1 个答案:

答案 0 :(得分:2)

您正在比较两个不同的回购,identinetics/saml2test2identinetics/docker-saml2test2