将本地代码推新的远程仓库

2019-05-26  本文已影响0人  吃啥呀

git GitHub


本地项目已经写好了,但是想推到 github 上,肿么办

1. 在 GitHub 上新建一个仓库

repository

2. 本地项目推倒远程仓库

在终端上进入本地仓库


terminal.png

为本地项目创建 git


image.png
git init 
git remote add origin https://github.com/远程仓库地址
git push -u origin master

发现失败了,因为还没有将本地仓库的东西先 add,add 之后应当提交 commit


add.png
commit.png
git add *
git commit -m ""

这个时候再 push,push 成功,远程仓库也更新了


push.png
Remote repository.png
上一篇 下一篇

猜你喜欢

热点阅读