git使用教程 引用

注意linux和windows通用

前提:在github上面创建好自己的仓库

  创建仓库:

    1.登录github上

    2.点击头像下面的  Your repositories

    3.点击new 创建新的仓库  输入仓库名和public(全球可见) private(私人可见)

    4.得到仓库的url,url的组成:https://github.com/用户名/仓库名.gt

提交项目到github:

1.cd ***     #进入到自己的项目目录 

2.git init   #在当前项目中生成本地的git管理

3.git add 文件名 

  eg:git add . 将项目中的所有文件添加到仓库中,

       git add 文件名  #将项目中特定的文件添加到仓库中

4.git commit  -m  注释  #提交文件见到仓库中

 这一步:根据提示输入用户名和邮箱

5.git remote add origin https://自己的仓库url地址     #将本地的仓库关联到github上,

6.git push -u origin master     #将代码上传到仓库   等一会·会跳出输入输入github的用户名和密码  输入即可,然后查看github的仓库中会发现多了文件

至此上传到github教程结束

参考:

https://blog.csdn.net/m0_37725003/article/details/80904824

https://www.cnblogs.com/zouwangblog/p/11201561.html

https://www.runoob.com/w3cnote/git-guide.html  讲的最明白的

http://marklodato.github.io/visual-git-guide/index-zh-cn.html