前期准备:github账号,安装git
在右上角新建一个库

起一个面子我这里就先写成了test,点击create repository ,进入如下页面

根据上面的提示 ,我们首先要找到你要传上去的文件夹,
$git init

在文件夹中出现了 .git 文件

然后 $git add .
是添加所有文件,然后如果是首次上传的话,git commit -m "first commit" 必须要上市 -m "first commit" 是提交注释,方便下次查看的时候,知道提交的是什么,
然后 git remote add origingit@github.com:AlisaMFZ/test.git 这个是我的库地址

此时已经连接到我的库地址了,
$ git push -u origin master
把本地库的内容推送到远程,用git push命令,实际上是把当前分支master推送到远程。
由于远程库是空的,我们第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。

已经上传好了
再去github上查看自己的库,

网友评论