github - 如何将 github 子模块分支“A”中的更改拉入父模块分支“B”
问题描述
我在存储库 A 中进行了一些更改,这些更改反映在分支 A 中。此存储库 A 是存储库 B 的子模块。我想在存储库 B 的分支 Y 中反映存储库 A 的分支 A 更改。我该怎么做?
解决方案
让我们X
成为 submodule 的一个分支,A
并Y
成为 parent repository 的一个分支B
。
切换到X
并更改目录到B
. 运行git status
会显示如下内容:
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: A (new commits)
no changes added to commit (use "git add" and/or "git commit -a")
然后切换到Y
并提交更改:
git switch Y
git add A
git commit
推荐阅读
- python - 使用 sudo python3 get-pip.py 安装 pip 的见解
- c# - 我如何将新画布实例化为画布,并在 MainCamera 上设置屏幕空间?
- rest - 有没有办法使用 aws api-gateway 使用 REST API 获取全局二级索引中的所有项目?我只能得到一些
- omnet++ - 找不到错误 ueAppIdToMeAppMapKey 条目
- ruby-on-rails - 如何在 ruby 的哈希中制作 deep_slice
- unity3d - 如何在移动设备的 x 或 y 轴上检测手指拖动?
- angular - Angular 11:错误 TS2339:“对象”类型上不存在属性“数据”,但一切正常
- java - 有没有办法通过安卓应用程序创建键盘宏?
- c# - 如何隐藏/更改起始页中的 URL?
- android - Android 自动填充服务在 Chrome 中不起作用