本地代码上传GitHub详解

1 、登录github,创建目标代码的仓库  https://github.com/fangcunlingtai/skin-core.git

2、本地代码完成commit之后添加远程仓库 执行推送

    git remote add origin https://github.com/fangcunlingtai/skin-core.git

    git push -u origin master

3 、推送失败情况 

10:12 Push failed

Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.

git@github.com: Permission denied (publickey).

Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

需求将本地的ssh 公钥添加到账号

github->settings->SSH and GPG keys - > SSH keys -> new keys  添加公钥内容

title 随便写 ,key  输入 .ssh/id_rsa.pub 内容 ,如果 .ssh下没有id_rsa 和id_rsa.pub则可以命令生成。

4、生成公钥方法

用户根目录 .ssh 文件夹下 右击 git bash here

ssh-keygen -t rsa -C "xxxxx@xxxxx.com", 一路回车就行。


配置完毕 再执行  推送就可以了。

 git remote add origin https://github.com/fangcunlingtai/skin-core.git

 git push -u origin master

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。