0

There are two repositories, both started from one place. Now both have slightly diverged. A already has an origin remote. B is on some different remote, let's say origin2.

A: (last common commit)--------------------> A1 -> A2 (28 commits in total)

B: (last common commit) -> B1 -> B2 -> B3 (29 commits in total)

How do I take B1, B2 and B3 into A? In other words

Desired: A: (last common commit) -> B1 -> B2 -> B3 -> A1 -> A2 (31 commits in total)

Ideally I'd like to keep the hashes and commit-names of the B's.

Sorry
  • 532
  • 2
  • 6
  • 19
  • "Both started from one place" seems in contradiction with the fact they have different origins. When a repo is created by cloning, `origin` is the source of the cloning process. So do you mean they are cloned from the same logical repo, but different servers/machines? – Romain Valeri Jun 12 '19 at 19:34
  • If master is on a: (`git ckeckout master`) `git merge origin2/master` – dan1st Jun 12 '19 at 19:46
  • @dan1st `merge: orign2 - not something we can merge` – Sorry Jun 12 '19 at 21:04
  • @LeNguyenDuyAnh not `origin2` but `origin2/master` (see https://stackoverflow.com/questions/21651185/git-merge-a-remote-branch-locally) – dan1st Jun 13 '19 at 04:42
  • @dan1st `merge: origin2/master - not something we can merge` unfortunately. – Sorry Jun 13 '19 at 16:10
  • What is the output of `git branch -a`? – dan1st Jun 13 '19 at 17:36
  • @dan1st nvm i solved it by using `git rebase -i origin2/master` – Sorry Jun 13 '19 at 18:18

0 Answers0