1.首先需要给项目Project创建个版本库(仓库)

这样Project里每个文件的修改,删除等操作,git才能追踪管理。使用 git init 命令把Project变成git可以管理的仓库。

PengJiangdeMacBook-Pro:GaoDeMap PengJiang$ git add .

PengJiangdeMacBook-Pro:GaoDeMap PengJiang$ git commit -m "add all files"//将所有文件都提交到git
2.把文件放到git仓库

3.把本地仓库与Coding上的仓库关联
用 git remote add origin 地址关联
PengJiangdeMacBook-Pro:GaoDeMap PengJiang$ git remote add origin https://github.com/PengJiang520/GaoDeMap.git//https://github.com/PengJiang520/GaoDeMap.git 你的远程仓库名(我用的是GitHub的 如果用coding 也可以)

PengJiangdeMacBook-Pro:GaoDeMap PengJiang$ git remote -v

4.把本地库的所有内容推送到Coding远程库上
终于来到这一步啦。用 git push origin master 命令

git clone https://git.coding.net/huang002/Project.git //(https://git.coding.net/huang002/Project.git你的远程仓库链接)到电脑上就可以继续工作了吧。
网友评论