ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

Git 远程公共分支 到 本地个人分支

Git 远程公共分支 到 本地个人分支

config文件增加一节,配置远程公共分支:

[remote "origin"]

url = http://XXX.s/my/repo.git

fetch = +refs/heads/*:refs/remotes/origin/*

[remote "origin-common"]

url = http://XXX.s/common/repo.git

fetch = +refs/heads/*:refs/remotes/origin-common/*

1、创建个人分支

远程公共分支 --fork--> 远程个人分支

|

V

本地个人分支(添加远程公共分支地址)

2、拉取、提交代码

远程公共分支 <-- 远程个人分支

\ ^

\ /

V /

本地个人分支

返回列表