防止忘记,自己记录了下在本地文件上传到github的步骤。(这是Windows下的步骤)
进入github官网进行注册,登录。还需要安装git工具。(这些省略)
1.进入github首页,点击new respository新建一个项目,写入respository name,然后写上description,也可以不写。填写完后直接点击create respository。然后点解respository的名字,出现如下图所示:

点击README,在点击commit new file,出现这个界面:

2.如果git安装好只有,鼠标右键会有个Git Gui Here,Git Bash Here,这里我们选择Git Bash Here。
3.进入到你所要上传本地文件的目录,执行git clone https://github.com/Fairy6/ssm.git(该地址换成你自己的地址),把github上面的仓库克隆到本地

7.这个步骤以后你的本地项目文件夹下面就会多出个文件夹,该文件夹名即为你github上面的项目名,如图我多出了个ssm文件夹,我们把本地项目文件夹下的所有文件(除了新多出的那个文件夹不用),其余都复制到那个新多出的文件夹下。

8.进入ssm文件夹下:cd ssm
9.接下来依次输入以下代码即可完成其他剩余操作:
git add . (注:别忘记后面的.,此操作是把ssm文件夹下面的文件都添加进来)
git commit -m "提交信息" (注:“提交信息”里面换成你需要,如“first commit”)
git push -u origin master (注:此操作目的是把本地仓库push到github上面,此步骤需要你输入帐号和密码)



10.刷新页面,查看github本地文件是否上传到ssm这个respository。

网友评论