首页 > 其他 > 详细

github推送

时间:2020-01-19 11:12:20      阅读:58      评论:0      收藏:0      [点我收藏+]

create a new repository on the command line

echo "# proxypool" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/xxx/proxypool.git
git push -u origin master



##需要输入账号密码

push an existing repository from the command line

git remote add origin https://github.com/xxxx/proxypool.git
git push -u origin master

免密传输代码

#创建仓库后获取ssh地址仓库
Clone with SSH 
Use a password protected SSH key.


git@github.com:xxxx/proxypool.git


##配置本机公钥到github
cat   ~/.ssh/id_rsa.pub   
复制到github  用户settings--->SSH and  GPG keys----->new  ssh  keys
粘贴即可.



##操作使用ssh仓库地址
使用 git remote rm origin 命令移除HTTPS的方式
使用命令 git remote add origin git地址 (git地址是上面复制的内容),新添加上SSH方式
使用 git remote -v 命令,再次查看clone的地址,会发现git使用的方式变成了SSH方式


#################################
##1,完整操作流程(首先获取到ssh  仓库地址)
#################################


#################################
##2,配置本机公钥到github并测试
#################################
ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.
Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.



#################################
##3,初始化本地仓库
#################################

git init
git add *
git commit -m "first commit"
git remote add origin git@github.com:xxxx/proxypool.git
git push origin master

参考:
https://blog.csdn.net/inthuixiang/article/details/79734245

github推送

原文:https://www.cnblogs.com/g2thend/p/12212813.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!