windows使用git上传代码到github:
提示:git一些主要命令:
前提是已经下载好git以及注册好github
1、 本地和github的连接配置(进入要提交项目路径,打开git bash)
提示:命令: ssh-keygen -t rsa -C "XXX@qq.com"(gtihub注册邮箱)(中间遇到的直接enter) 打开github-setting-把密钥输入 **注意:(不要从命令行复制,找到c盘,看到id_rsa.pub用记事本打开,复制然后粘贴到SSH key中,名字随便取)** ` 
 
$ ssh -T git@github.com (判断连接是否成功)(中途遇到的直接yes)

git 没有配置的可以自行配置一下,命令行如下 git config --global uer.name “XXX”(自己取) git config --global user.email “yyy.com”(邮箱)
2、进行项目上传
git init git add . (点号不要漏了) git commit -m "first commit" (引号部分是为了自己方便看记录,可自行写) git remote add origin (GitHub上项目的ssh地址,如下图)  git push -u origin master
注意:(如果该语句出现问题,使用git pull --rebase origin master(更新,需要把仓库拉回来)) 然后再使用该语句
再去看github上你的仓库就会发现上传成功(在master分支里)! 
All is well!!!
|