1:上传自己的代码

1:先注册自己的账号,填入一些资料;

使用命令 :创建本地ssh

ssh-****** -t rsa -C "[email protected]"后邮箱为github的注册邮箱;

路径选择 :使用该命令之后,会出现提示选择ssh-key生成路径,这里直接点回车默认即可,生成的ssh-key在默认路径中;

然后按照提示路径,找到生成ssh-key的地方,复制,然后写入到github中新添加ssh key,titile可以随便写


用户名邮箱作用 :我们需要设置一个用户名和邮箱,这是用来上传本地仓库到GitHub中,在GitHub中显示代码上传者;

使用命令 : 

[java] view plain copy使用github详细介绍使用github详细介绍
  1. git config --global user.name  "HanShuliang" //设置用户名   
  2. git config --global user.email  "[email protected]//设置邮箱  

2:

(1) GitHub中创建一个工程:

然后按照上面的提示上传:
  1.        touch README.md
  2. git add README.md  
  3. git commit -m "first commit"  
  4. git remote add origin [email protected]:377122210/qq.git  
  5. git push -u origin master 
    一般都是这几步,然后就可以到里面看到自己的代码了

README.md 这个东西一定要弄;


后面如果新增加了代码,则用git GUI直接上传:

使用github详细介绍

https://zhuanlan.zhihu.com/p/21438729?refer=crossin


相关文章: