前言
本文介绍的是Git同步原始仓库到Fork仓库示例教程,废话不多说,下面直接到实操部分。
这里以aspnetcore-doc-cn的github仓库为例,同步dev分支。
步骤
1.初始化本地仓库
mkdir aspnetcore-doc-cn
cd aspnetcore-doc-cn
git init
2.添加远程仓库地址
添加原始仓库地址,就是被Fork的。
git remote add parent https://github.com/dotnetcore/aspnetcore-doc-cn.git
地址是https协议的,不能是ssh协议的,除非有权限。
添加自己远程仓库地址