将本地目录上传值git仓库

创建git仓库

以github为例,登录账号建立一个仓库,然后将仓库地址copy下来。

本地目录

  1. 初始化
$ git init
  1. 添加至版本库
$ git add -A
  1. 提交
$ git commit -m "first commit"
  1. 关联至远程仓库
$ git remote add origin https://github.com/user/project.git
  1. 合并
$ git pull --rebase origin master
  1. 推送
$ git push -u origin master
posted @ 2017-07-13 22:49  月半流云  阅读(196)  评论(0编辑  收藏  举报