当前位置:网站首页>主子仓库都修改,如何进行同步?
主子仓库都修改,如何进行同步?
2022-07-29 10:25:00 【furfur-jiang】
主仓库切换分支的时候,子仓库会受到什么影响?
主仓库切换,子仓库不变。
这个概念非常重要,很多人不理解这个不变是指什么?
举个例子:
设:远程的master子仓库a版本id是111,远程的master子仓库a版本id是222。
从master切换到dev,master有个子仓库a版本id是111,切换到dev后,子仓库a版本id还是111,本地与远程不一致。
本地与远程如何变得一致呢?
git submodule update
使用此命令后,会去远程重新同步dev分支下的子仓库链接
也就是dev分支的子仓库a版本id变成222,本地与远程一致
当主仓库和子仓库都做了修改,如何同步到远程?
难点:dev的子仓库和master的子仓库版本不同,直接合并会冲突。
利用本地与远程的不一样性,可以进行不回滚修改。
前期提要:正常开发应当至少有dev分支和master分支,你应当在dev分支进行开发,然后合并到master
具体操作:
首先在dev:进入子仓库目录提交你子仓库,所有更新到dev分支,即add/commit/push三件套(子仓库的master也是同理,不过先merge),同样方式提交你的主仓库。
然后:
cd退到主仓库,此时的主仓库应当在dev分支,
切换到master分支,git submodule update 此时的主仓库和子仓库链接都更新为master的
此时,dev分支子仓库链接同master,因为切换分支不会导致链接更新,所以,可以利用这个间隙,将主仓库更新过去,
接着:
git merge dev 将dev合并过来,由于子仓库链接一致就不会产生冲突,更新完主仓库,可以同时修改子仓库,
即进入子仓库,切换到master分支,(直接进来分支是历史提交记录)退回主仓库,即可看到有子仓库有更新,此时就可以一起提交到远程。
如上所述,主子仓库更新完毕
要继续进行后续开发注意
Git checkout dev
Git submodule update
更新dev分支的子仓库链接
现状

首先






边栏推荐
- 2022cuda summer training camp Day5 practice
- How to integrate Google APIs with Google's application system (3) -- call the restful service of Google discovery API
- Two MySQL tables with different codes (utf8, utf8mb4) are joined, resulting in index failure
- Why use markdown to write?
- Print out the "hourglass" and the remaining number according to the given number of characters and characters
- MySQL 8 of relational database -- deepening and comprehensive learning from the inside out
- Implementation of college logistics repair application system based on SSM
- Where are those test / development programmers in their 30s? a man should be independent at the age of thirty......
- 【配置相关】
- Explore SQL Server metadata (I)
猜你喜欢

What is "enterprise level" low code? Five abilities that must be possessed to become enterprise level low code

Shell笔记(超级完整)

Research on the realization of linear gradient circular progress bar

Knowledge points of common interview questions: distributed lock

关系型数据库之MySQL8——由内而外的深化全面学习

Attachment of text of chenjie Report

为什么要使用markdown进行写作?

Oracle advanced (XIV) explanation of escape characters

【论文阅读】Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT

DW: optimize the training process of target detection and more comprehensive calculation of positive and negative weights | CVPR 2022
随机推荐
【论文阅读】Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
Implementation of college logistics repair application system based on SSM
Second handshake?? Three waves??
paho交叉编译
Is error log monitoring enough? Don't try JVM monitoring of microservices
MySQL million level data migration practice notes
Where are those test / development programmers in their 30s? a man should be independent at the age of thirty......
[paper reading] i-bert: integer only Bert quantification
[FPGA tutorial case 18] develop low delay open root calculation through ROM
VMWare:使用命令更新或升级 VMWare ESXi 主机
架构实战营模块八作业
静态资源映射
消费电子,冻死在夏天
12代酷睿处理器+2.8K OLED华硕好屏,灵耀14 2022影青釉商务轻薄本
关系型数据库之MySQL8——由内而外的深化全面学习
Research on the realization of linear gradient circular progress bar
Correct posture and landing practice of R & D efficiency measurement (speech ppt sharing version)
This is the right way for developers to open artifacts
【日志框架】
[semantic segmentation] 2021-pvt iccv