1、登录github,创建仓库。

2、切换到要提交的文件目录下。

3、打开git bash 

  3.1、初始化仓库

git init 

  3.2、将本地仓库与远程仓库关联

git remote add origin https://github.com/lis-ylfy/config-test.git

  3.3、测试是否连接成功

git remote

  输出origin表示成功

  3.4、将文件提交到暂存区

git add .

 注意add 后面是空格,然后是 .

git add . : 监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件。

  3.5、填写提交说明

 git commit -m "first commit, first version"

  -m 后面就是提交说明

  3.6、提交到远程仓库

git push -u origin master 

  master是指主干分支

posted on 2018-08-18 17:41  顺蝈蝈  阅读(1166)  评论(0编辑  收藏  举报