git - 将远程 git 子树更改为我的分叉存储库
问题描述
在我的项目中,我有一个plugins
文件夹,它是一个指向ntc-templates
repo 的子树。
我为创建子树做了什么(来自此链接)
git remote add ntc_templates https://github.com/networktocode/ntc-templates.git --no-tag
git fetch ntc_templates
git read-tree --prefix=plugins -u ntc_templates/master
git status
git commit -m "Add ntc-templates plugin"
后来我发现我必须在 ntc-templates 项目中添加一些功能。我创建了一个分支来将这些更改提交到子树,但它失败了,显然是因为我不是ntc-templates
git checkout -b blackport-ntc ntc_templates/master
git cherry-pick -x 0264b2671a3
git cherry-pick -x --strategy=subtree 25a01494ef6
git push ntc_templates HEAD:master
所以现在,我分叉了他们的仓库,偶然地,最后一次ntc-templates/master
提交与我的分叉仓库相同(他们在我的克隆和我的 fork 之间没有新的提交)。
我怎样才能将我的子树从他们的仓库“迁移”到我的分叉树而不破坏我的仓库,因为 git 可能非常复杂......
非常感谢您的帮助
解决方案
推荐阅读
- z3 - Z3中的地图数据结构
- php - 在 Web 应用程序中集成 Microsoft AX Dynamics 2012 r3
- mysql - MySQL - 选择列值仅为0的行,按另一列分组?
- javascript - 在 MongoDB 中插入数据后无法从节点服务器获得响应
- python - 计算 pandas DataFrame Rows 中的 Buy 和 SELL Qty 的差异
- sqlite - delphi fireac sqlite 提交
- kubernetes - 如何创建具有公共和私有托管区域的 Kubernetes 集群(使用 KOPS)?
- c - 如何在 Linux 中使用 c-api 查找 VRF 设备的路由表 ID
- php - Laravel 原始表达式查询本地化 (v 5.6)
- android - 找不到符号方法 setUser_list_user_view(User_List_UserViewModel) 虽然它在绑定类中可用