@chenxinfeng
2016-07-20T11:31:00.000000Z
字数 828
阅读 60
$ git clone https://github.com/chenxinfeng4/hello-world-1.git
制作mrdoob
变量,名称任意,赋予该值别人的云git
。 假定所有git库都只有master
一个分枝 (Git的规范是用master
做主分枝、主进程,一般这样设定不会出错)。
$ git remote add mrdoob https://github.com/ibpwyw/hello-world.git
查看是否成功。
$ git remote -v
mrdoob https://github.com/ibpwyw/hello-world.git (fetch)
mrdoob https://github.com/ibpwyw/hello-world.git (push)
origin https://github.com/chenxinfeng4/hello-world-1.git (fetch)
origin https://github.com/chenxinfeng4/hello-world-1.git (push)
get 别人的云git到本地的幕后 (你看不到改变,但改变的确发生了)
$ git fetch mrdoob
查看是否成功 (亲眼看看幕后吧)。
$ git log mrdoob/master
本地的隐藏幕后展示出来 (这下就能看到真正的改变了)
$ git merge mrdoob/master
查看你是否设定了云。看看origin
的值,一般应该对应你的云。
$ git remote -v
执行push命令。前面的master
表示你本地的分枝,后面的master
表示云端的分枝(应该一致)。
$ git push origin master:master
默认的origin
和master
,有时可以省去。
$ git push