git工具使用10.10

2019-10-10  本文已影响0人  星球发动机

1,安装,前期配置和使用;參考如下:

https://www.liaoxuefeng.com/wiki/896043488029600

2,git在windows安裝之后,连接远程的github会出现三个问题:

ssh_dispatch_run_fatal: Connection to 13.250.177.223 port 22: Software caused connection abort

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

(1)这个问题是由于,本机的host没有github的地址,需要修改文件:C:\Windows\System32\drivers\etc\hosts

并且需要,有修改权限。保存后,执行 git push -u origin XXX;便没有问题了,详细参考见:https://blog.csdn.net/hanchao5272/article/details/79393393

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.

(2)这个问题是,远程的git repository没有给,权限。由于你的机器没有:public key;也就是ssh钥匙。只需要在git里面 ssh-keygen -t rsa 生成秘钥:并且将pub秘钥的内容拷贝到你的

github账号的ssh key里面。如下截图:之后ssh -T git@github.com 验证是否成功。详细参考:https://blog.csdn.net/zhangbeizhen18/article/details/90759887

! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to 'git@github.com:

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

(3)由于远程github没有本地的orgin分支,需要将远程拉下来,并且合并。用git pull就可以拉下来合并。git pull --rebase https://github.com/xxx/xxx.git;详细参考:https://blog.csdn.net/weixin_38927964/article/details/85346443

至此:可以将本地的文件push到github上面。

上一篇 下一篇

猜你喜欢

热点阅读