把一个仓库的提交同步到另一个仓库

432 阅读1分钟

从一个仓库cherry-pick提交到另一个仓库

  1. git remote或者git remote show,查看本地工程添加的远程仓库地址;
PS D:\project\xxx> git remote
origin
  1. 添加需同步commit的所属远程仓库地址 git remote add other http://gitlab.xxx.git

  2. 重复第一步,使用git remote get-url other可查看添加地址是否正确

PS D:\project\xxx> git remote
origin
other
  1. 同步远程仓库信息 git fetch other

  2. 复制需同步过来的commit_id git cherry-pick 61ecfaxxxxxxxxxxxxxxxx26233dfb168