git简易操作

git config --global user.name 'scales'
git config --global user.email "1477835701@qq.com"
ssh-keygen -t rsa -C "1477835701@qq.com"

cd e:
mkdir www
cd  www
mkdir myGit
cd myGit
pwd
git init

第二步:

  • 登录github,打开settings中的SSH Keys页面,然后点击Add SSH Key,填上任意title,在Key文本框里黏贴id_rsa.pub文件的内容。

  • 点击 Add Key,你就应该可以看到已经添加的key。

添加远程库

 

  • 首先,登录github上,然后在右上角找到create a new repo创建一个新的仓库。

  • Repository name填入testgit,其他保持默认设置,点击Create repository按钮,就成功地创建了一个新的Git仓库:

  • 目前,在GitHub上的这个testgit仓库还是空的,GitHub告诉我们,可以从这个仓库克隆出新的仓库,也可以把一个已有的本地仓库与之关联,然后,把本地仓库的内容推送到GitHub仓库。

  • 现在,我们根据GitHub的提示,在本地的testgit仓库下运行命令:

  • git remote add origin https://github.com/ColinScales/wechat.git git remote rm origin https不好用可以替换成SSH试一试

  • git add README.md

  • git commit -m 'README.md提交'

  • git push -u origin master

  • git clone https://github.com/ColinScales/wechat.git

posted @ 2017-01-06 15:58  孙凯亮  阅读(135)  评论(0编辑  收藏  举报