我在本身的vekko/RuoYi库改啊改,某一天源库y_project/RuoYi更新了,我怎么同步源库过来?git
进入本身本地库中经过git remote -v 查看源信息fetch
G:\vekko_cc_projects\RuoYi>git remote -v origin https://gitee.com/vekko/RuoYi.git (fetch) origin https://gitee.com/vekko/RuoYi.git (push)
fetch 和push 都是本身的源,全部咱们要添加repo的源code
添加上游repo源rem
G:\vekko_cc_projects\RuoYi>git remote add upstream https://gitee.com/y_project/RuoYi.git
注:删除为git remote remove upstreamget
而后再看一下源信息,能够看到上游源已经添加进来了同步
G:\vekko_cc_projects\RuoYi>git remote -v origin https://gitee.com/vekko/RuoYi.git (fetch) origin https://gitee.com/vekko/RuoYi.git (push) upstream https://gitee.com/y_project/RuoYi.git (fetch) upstream https://gitee.com/y_project/RuoYi.git (push)
G:\vekko_cc_projects\RuoYi>git fetch upstream From https://gitee.com/y_project/RuoYi * [new branch] master -> upstream/master
G:\vekko_cc_projects\RuoYi>git merge upstream/master Already up to date.
git push origin master