准备工作:
1.在github上创建GitTest

2.创建完项目后会有个项目地址(此处使用SSH)

上传本地项目到github
1.在桌面新建文件夹 GitLianXi
cd /Users/admin/Desktop/
mkdir GitLianXi
① cd 到刚新建的项目文件夹路径
② git clone + github上创建的GitTest项目地址

2.新建项目
① 新建项目 GitTestDemo
② 把本地要上传的项目放到刚才克隆的文件里面

3.执行以下语句:
git init (git 仓库的初始化)
git add . (注意:add 空格 再加 .)
git status (查看add 成功没)
git commit -m "描述" (“” 引号里面输入你的描述语)
git push origin master (push到github上)
github刷新后可看到仓库下刚添加的项目GitTestDemo

在sourceTree上新建仓库,把项目放在本地编辑



网友评论