Khakis7
Khakis7

Reputation: 433

How to untangle master / develop when they've been merged together

Somehow my release branch had develop merged into it. Due to the way our system works, we don't squash the commits so I now have a tangled branch where master and develop commits go together, without a single commit to reset back to or commit.

Is it possible to untangle this without reverting each an every develop commit?

For example:

Master had commits
xyz
xxy
zzy

Develop had commits
aab
bbc
cba

Now master looks like: 
xyz
aab
xxy
bbc
zzy
cba

Master hasn't been released yet, so is it possible to untangle those develop commits from master?

Upvotes: 0

Views: 51

Answers (1)

Tiberiu
Tiberiu

Reputation: 1030

One thing you could do is

git reset --hard to the commit before all of these, and then

git cherry-pick the other commits in the order you want them.

Upvotes: 1

Related Questions