美文网首页
使用 git subtree 共享代码

使用 git subtree 共享代码

作者: sbtiny | 来源:发表于2017-04-21 17:52 被阅读37次

假设 shared 是要共享的目录

添加远程分支
git remote add shared git@git.coding.net:wangjile/shared-code.git

git subtree push --prefix shared shared master

在要用的地方
git fetch shared
git subtree add --prefix shared shared/master
git subtree pull --prefix shared shared master --squash

可选

git subtree split --prefix shared --rejoin
会生成一个空的 commit 作为 base,
可以避免把所有的 commit loop 一遍

git subtree split --prefix shared -b backport
把改动切成分支,想咋改都行

参考

相关文章

  • 使用 git subtree 共享代码

    假设 shared 是要共享的目录 添加远程分支git remote add shared git@git.cod...

  • git subtree 的命令和使用说明

    git subtree add --prefix= git subtree add --...

  • git subtree相关问题

    使用git subtree有一段时间了,主要用来解决多个项目共同使用相同代码的同步问题,特意简单整理了一下相关知识...

  • git subtree

    git subtree 1.在A项目中添加一个远程连接如下: 2.使用subtree命令添加需要依赖的远程仓库 3...

  • Git Subtree的使用

    背景 项目A与项目B存在公用模块,在项目A中修改Bug或增加新功能需要同步到项目B中,由于存在区别所以还不能完全c...

  • git subtree 的使用

    参考:Git Tools - Subtree MergingThe power of Git subtreegit...

  • git merge two repos

    git clone git_linkFirstly add subtree, from which you wan...

  • Git命令

    进入到项目目录使用终端git init 可以初始化一个git仓库 建立代码共享仓库 git init --bare...

  • GitHub超简单小白入门详细教程(11)——使用Git管理远程

    使用Git管理远程仓库 使用远程仓库的目的 作用:备份,实现代码共享集中化管理 Git克隆操作 目的:将远程仓库(...

  • Git依赖subtree

    Git依赖——subtree  与submodule相比,subtree的优势在于主项目与子模块的双向 通信,即主...

网友评论

      本文标题:使用 git subtree 共享代码

      本文链接:https://www.haomeiwen.com/subject/jabdzttx.html