git关联github
1.配置用户名( "username"是自己的账户名)
git config --global user.name "wangmyhome"
2.配置邮箱 ("username@email.com"注册账号时用的邮箱)
git config --global user.email "username@email.com"
以上命令执行结束后,可用 git config --global --list 命令查看配置是否OK
git config --global --list
3.执行以下命令,生成ssh
ssh-keygen -t rsa
然后连敲三次回车键,结束后去系统盘目录下(一般在 C:\Users\你的用户名.ssh)(mac: /Users/用户/.ssh)查看是否有。ssh文件夹生成,此文件夹中以下两个文件 id_rsa、id_rsa.pub  4.将ssh文件夹中的公钥( id_rsa.pub)内容添加到GitHub管理平台中,在GitHub的个人账户的设置中找到如下界面 
title随便起一个,将公钥( id_rsa.pub)文件中内容复制粘贴到key中,然后点击Add SSH key就好啦
5.测试一下配置是否成功,在Git Bush命令框(就是刚才配置账号和邮箱的命令框)中继续输入以下命令,回车
ssh -T git@github.com

git提交项目到github
1、本地项目上传到gitee
git init
git remote add origin https://github.com/wangmyhome/JavaLollipop.git
git pull origin master
git add .
git commit -m ‘描述‘
git push origin master
   2、更新代码提交
1.查看本地代码和本地仓库中代码的区别
$ git status
2.确认无误后更新全部修改到本地仓库
$ git add *
3.提交修改
$ git commit -m “说明信息”
4.获取远程仓库指定分支的最新代码
$ git pull origin master
5.上传到远程仓库指定分支上
$ git push origin master
|