将本地工程上传到github

将本地工程上传到github

首先需要你有一个github账号,然后添加好SSH key

接下来:需要创建两个库,远程库和本地库,先建立远程库

1. 在github上穿件一个远程仓库

 

2. 开始建立本地库,按照以下的步骤一步一步做下去

1)  git init(在本机上想要创建一个新的git仓库)

2) git add . (表示添加全部)

3) git remote add origin xxxxxxxxxxxxxxxxxxx(你远程仓库的地址) 关联远程仓库

4) git commit -m "my first commit"

5) git pull --rebase origin master 更新远程更新到本地(这一步一定要在下一步之前,否则会报错,本地push到远程前一定要

先讲远程的更新pull到本地)

推送本地更新到远程:

6) git push origin master 将本地repo和远程的origin的repo合并

7) git pull (上传add的代码)

此时你会发现,代码已经上传成功啦哈哈哈哈

posted @ 2016-10-19 20:01  chenyHAHA  阅读(509)  评论(0编辑  收藏  举报