赞
踩
比如: 我fork mybatis-3的源码库到自己的仓库(取名为:mybatis-3-note)
这个比较简单,点击fork按钮就行
~/mygithub/mybatis-3-note master ✔ 4d4h ⍉
▶ git remote add upstream git@github.com:mybatis/mybatis-3.git
这里的upstream是自定义的名字,随便取名什么都行,目的是标记这个与源代码库建立关联
~/mygithub/mybatis-3-note master ✔ 4d5h
▶ git remote -v
origin git@github.com:xxx/mybatis-3-note.git (fetch)
origin git@github.com:xxx/mybatis-3-note.git (push)
upstream git@github.com:mybatis/mybatis-3.git (fetch)
upstream git@github.com:mybatis/mybatis-3.git (push)
这里发现创建了一个叫做upstream的与源代码origin关联
~/mygithub/mybatis-3-note master ✔ 4d5h ⍉ ▶ git fetch upstream 3.4.x:3.4.x remote: Enumerating objects: 77, done. remote: Counting objects: 100% (16/16), done. remote: Total 77 (delta 16), reused 16 (delta 16), pack-reused 61 Unpacking objects: 100% (77/77), done. From github.com:mybatis/mybatis-3 * [new branch] 3.4.x -> 3.4.x * [new tag] mybatis-3.0.1 -> mybatis-3.0.1 * [new tag] mybatis-3.0.2 -> mybatis-3.0.2 * [new tag] mybatis-3.0.3 -> mybatis-3.0.3 * [new tag] mybatis-3.0.4 -> mybatis-3.0.4 * [new tag] mybatis-3.0.5 -> mybatis-3.0.5 * [new tag] mybatis-3.0.6 -> mybatis-3.0.6 * [new tag] mybatis-3.1.0 -> mybatis-3.1.0 * [new tag] mybatis-3.1.1 -> mybatis-3.1.1 * [new tag] mybatis-3.2.0 -> mybatis-3.2.0 * [new tag] mybatis-3.2.1 -> mybatis-3.2.1 * [new tag] mybatis-3.2.2 -> mybatis-3.2.2 * [new tag] mybatis-3.2.3 -> mybatis-3.2.3 * [new tag] mybatis-3.2.4 -> mybatis-3.2.4 * [new tag] mybatis-3.2.4-SNAPSHOT -> mybatis-3.2.4-SNAPSHOT * [new tag] mybatis-3.2.5 -> mybatis-3.2.5 * [new tag] mybatis-3.2.5-SNAPSHOT -> mybatis-3.2.5-SNAPSHOT * [new tag] mybatis-3.2.6 -> mybatis-3.2.6 * [new tag] mybatis-3.2.6-SNAPSHOT -> mybatis-3.2.6-SNAPSHOT * [new tag] mybatis-3.2.7 -> mybatis-3.2.7 * [new tag] mybatis-3.3.0 -> mybatis-3.3.0 * [new tag] mybatis-3.3.0-SNAPSHOT -> mybatis-3.3.0-SNAPSHOT * [new tag] mybatis-3.4.0 -> mybatis-3.4.0 * [new tag] mybatis-3.4.1 -> mybatis-3.4.1 * [new tag] mybatis-3.4.2 -> mybatis-3.4.2 * [new tag] mybatis-3.4.3 -> mybatis-3.4.3 * [new tag] mybatis-3.4.4 -> mybatis-3.4.4 * [new tag] mybatis-3.4.5 -> mybatis-3.4.5 * [new tag] mybatis-3.4.6 -> mybatis-3.4.6 * [new tag] mybatis-3.5.0 -> mybatis-3.5.0 * [new tag] mybatis-3.5.1 -> mybatis-3.5.1 * [new tag] mybatis-3.5.10 -> mybatis-3.5.10 * [new tag] mybatis-3.5.11 -> mybatis-3.5.11 * [new tag] mybatis-3.5.12 -> mybatis-3.5.12 * [new tag] mybatis-3.5.13 -> mybatis-3.5.13 * [new tag] mybatis-3.5.2 -> mybatis-3.5.2 * [new tag] mybatis-3.5.3 -> mybatis-3.5.3 * [new tag] mybatis-3.5.4 -> mybatis-3.5.4 * [new tag] mybatis-3.5.5 -> mybatis-3.5.5 * [new tag] mybatis-3.5.6 -> mybatis-3.5.6 * [new tag] mybatis-3.5.7 -> mybatis-3.5.7 * [new tag] mybatis-3.5.8 -> mybatis-3.5.8 * [new tag] mybatis-3.5.9 -> mybatis-3.5.9 * [new branch] 3.4.x -> upstream/3.4.x
~/mygithub/mybatis-3-note master ✔ 4d5h ▶ git fetch upstream remote: Enumerating objects: 386125, done. remote: Counting objects: 100% (198/198), done. remote: Compressing objects: 100% (3/3), done. remote: Total 386125 (delta 195), reused 198 (delta 195), pack-reused 385927 Receiving objects: 100% (386125/386125), 94.05 MiB | 1.93 MiB/s, done. Resolving deltas: 100% (350860/350860), completed with 98 local objects. From github.com:mybatis/mybatis-3 * [new branch] 3.2.x -> upstream/3.2.x * [new branch] 3.3.x -> upstream/3.3.x * [new branch] gh-pages -> upstream/gh-pages * [new branch] master -> upstream/master * [new branch] renovate/maven-org.hsqldb-hsqldb-vulnerability -> upstream/renovate/maven-org.hsqldb-hsqldb-vulnerability * [new tag] mybatis-3.2.8 -> mybatis-3.2.8 * [new tag] mybatis-3.3.1 -> mybatis-3.3.1
这就同步到了原代码库的分支到自己的代码库。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。