GCTT(Go Chinese Translation Team) sync.sh同步命令详解

Posted fudianheg

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GCTT(Go Chinese Translation Team) sync.sh同步命令详解相关的知识,希望对你有一定的参考价值。

git remote  add upstream https://github.com/studygolang/GCTT

添加fork项目的远程仓库(只需操作一次)

 

此时使用

git remote -v

zuoguoyaodeMacBook-Pro:GCTT zuoguoyao$ git remote -v

origin https://github.com/zuoguoyao/GCTT.git (fetch)

origin https://github.com/zuoguoyao/GCTT.git (push)

upstream https://github.com/studygolang/GCTT.git (fetch)

upstream https://github.com/studygolang/GCTT.git (push)

 

git fetch upstream 

获取上游改动

 

git checkout master 

转到master分支

git rebase upstream/master 

合并分支,结果等同于merge.git实现的机制不一样

参考下文

http://gitbook.liuhui998.com/4_2.html

 

git push -f  origin master

强制(-f )覆盖远程 origin仓库的master分支

 

 

 

 

以上是关于GCTT(Go Chinese Translation Team) sync.sh同步命令详解的主要内容,如果未能解决你的问题,请参考以下文章

『GCTT 出品』测试 Go 语言 Web 应用

『GCTT 出品』如何写 Go 中间件

[GCTT] Go 语言核心文件调试

『GCTT 出品』可视化 Go 语言中的并发

『GCTT 出品』Donng Go 语言的优点,缺点和令人厌恶的设计

『GCTT 出品』你所不知道的 Go 语言的一些令人惊叹的优点