美文网首页
git for window 上传本地代码到github

git for window 上传本地代码到github

作者: 何昊天 | 来源:发表于2017-05-11 17:04 被阅读0次

一路坎坷的为了实现将本地代码上传至github上,各种博客各种参考翻阅,自己按照他人的实现去操作,总是操作失败,记录此次操作过程。

github 官网 ,在settings里面设置ssh-key

命令: ssh-keygen -t rsa -C "22@qq.com"   --- 22@qq.com  为github登录账号

找到id_rsa  所在的目录,打开id_rsa.pub 并复制内容粘贴到github settings 中ssh-key

check 命令: ssh -T git@github.com

//创建git 远程仓库

登录后在profile 新增仓库git_workspace(自定义)

git init

设置全局配置,区分上传者

git config --global user.name "醉清风"

git config --global user.email "22@qq.com"

//本地仓和git 远程 添加映射(姑且叫映射)

git remote add origin git@github.com:222/git_workspace.git

添加需要上传的工程

git init

git add web

git commit -m 'first commit'

------------

git push origin master

相关文章

网友评论

      本文标题:git for window 上传本地代码到github

      本文链接:https://www.haomeiwen.com/subject/jwnotxtx.html