把上游仓库fork到自己github的仓库
fork
用github的fork按钮就可以了clone
把自己的github仓库clone到本地
配置上游仓库地址
git remote add upstream https://github.com//ORIGINAL_OWNER/ORIGINAL_REPOSITORY
fetch上游仓库的文件
git fetch upstream
切换到本地分支
git checkout mater
合并上游分支到本地分支
git merge upstream/master
或者
git rebase upstream/master
用pull也可以
git pull <远程主机名> <远程分支名>:<本地分支名> --rebase