// 连接到远程仓库 $ git remote add [shortname] [url] 例 git remote add origin git@github.com:yourName/yourPreo.git //yourName 是github为\远端的用户名 yourPreo是远端仓库的名字
首先进入本的地的仓库
$ cd yourPreo
将仓库下面的文件提交
$ git add yourfile
$git status -s //可以简洁的查看一下提交到缓存的内容
$ git commit -m "" //引号里面添加注释 commit 命令将缓存里面的内容添加到本地仓库
$git push [alias] [branch] //push 到远端仓库
如果远端仓库有更新 在命令行执行以下的其中一种
$ git fetch [alias] //alias 是远程仓库的别名
$git merge [branch] //branch 是分支 表示你想要合并到的分支上
第二种 $git pull //和上面俩行命令效果一样