I’ve been trying to merge my dev branch into the master branch but as this is my first time, I think I’ve completely misunderstood the terminology.
First, I tried a merge:
I tried to merge dev into master which didn’t work. When resolving conflicts, I used “ours” thinking this meant merging “my” dev branch into the master but while things changed, the site didn’t look the same as it did when the dev branch was checkout.
Then I tried a rebase:
I then rather recklessly tried a rebase thinking this would force the master branch to be identical to the dev branch but again, possible used the wrong options to resolve the conflicts as the site looks the same as it did after the initial merge.
At this point, can I force the master branch to be the same as the dev branch?
If I switch back to the dev branch the site looks correct – how do you merge the changes into the master branch so the site looks the same as when the dev branch is checked out?
Or at this point, is there a way just to force master to be the same as dev?
Sorry if this is easy, I find the terminology in git confusing and seemingly didn’t understand the answers/tutorials I’ve read – any help would be much appreciated.
BTW, I’m using the Mac Git client, Tower.
Cheers
If you want to “force the master to be the same as the dev”, the procedure which will always work is to:
git checkout dev; git branch -D master)git branch master; git checkout master)… Now the two branches are identical (same
HEADand thus same history).Your problem is likely that you didn’t reset after your botched merge. In theory, either a rebase (with a common ancestor) or a merge will produce a branch which integrates changes from both branches. If the merge doesn’t go as you hoped, reset back to before it and try again. Don’t commit the result until you’re happy with it!