git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
balancircle
V2EX  ›  git

请教一个 git 代码移植的问题

  •  
  •   balancircle · Jul 3, 2023 · 2828 views
    This topic created in 1224 days ago, the information mentioned may be changed or developed.
    请教一个 git 代码移植的问题:
    比如,我下载了 ShardingSphere 的 github 源码。
    然后,自己基于 master 分支,新建了一个分支,修改了某些适用于自己业务的源码,提交到公司的私服 gitlab 上。
    后续如何把 github 上的 fixbug 的源码,“移植”到自己公司私有 gitlab 上的呢?
    5 replies  •  2023-07-03 21:09:29 +08:00
    wxg4net
    wxg4net
    Jul 3, 2023
    1
    cherry-pick
    cwang22
    cwang22
    Jul 3, 2023❤️1
    2
    设置两个 remote ,从 Github remote 上拉取 master 的新 commits ,然后合并到你自己的分支上,再提交到 gitlab remote
    unco020511
    unco020511
    Jul 3, 2023
    3
    定期 rebase or merge
    unco020511
    unco020511
    Jul 3, 2023
    4
    哦,你说的是两个隔离的仓库,对楼上说了,设置两个 remote
    balancircle
    balancircle
    OP
    Jul 3, 2023
    5
    @cwang22 原来还可以设置两个 remote ,多谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   755 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 17:31 · PVG 01:31 · LAX 09:31 · JFK 12:31
    ♥ Do have faith in what you're doing.