I've managed to get two unrelated branches somehow synchronized, such that git log
s for both branches are now pretty much identical. Here's how I manged this feat:
- I was working in a branch
dev
. - Fetched and checkout out
releaseBranch
, but forgot to commit changes made todev
. - Realized my mistake and checkout
dev
and committed my changes. - Deleted
releaseBranch
and re-fetched and checkout another branch. - As shown below,
git log
now shows identical commits for not branches, and two HEADs
git log
on dev
commit f6824f8f7e85d27087d91f7b2ed18d6ac0bb3b2c (HEAD -> releaseBranch, dev)
Author: Me <me@example.com>
Date: Mon Jan 23 12:13:17 2023 +0000
Last commit to dev
git log
on release Branch
commit f6824f8f7e85d27087d91f7b2ed18d6ac0bb3b2c (HEAD -> dev, releaseBranch)
Author: Me <me@example.com>
Date: Mon Jan 23 12:13:17 2023 +0000
Last commit to dev
What's the best way to untangle myself from this mess?
git version 2.25.1