4

master -> completely messed up, my first time using gitmergetool

backup -> works fine.

How should I merge backup with master and make backup take precedence on everything, including files that exist in master but not in backup being deleted.

I've run a gun git reset --hard <hash where everything was peachy> and have the project back to before I attempted the merge. So how should I proceed to merge? I'm not sure where the conflicts have come from. I must have committed to the master, but I don't remember doing so.

I was thinking it would be easier to delete master and then rename backup to master, or checkout -b master or should I try to merge?

Nikhil Gupta
  • 1,708
  • 1
  • 23
  • 38
Starkers
  • 10,273
  • 21
  • 95
  • 158

3 Answers3

1

So long as you're one hundred percent sure the remote branch is perfect and the commit id is for a commit for when everything was fine, this is a pretty sure fire way to solve all your woes:

git checkout backup
git reset --hard <hash where everything was peachy>
git checkout master    
git merge -s recursive -Xtheirs backup
Starkers
  • 10,273
  • 21
  • 95
  • 158
1

Just point master to the same place as backup:

git checkout master
git reset --hard backup
Leif Gruenwoldt
  • 13,561
  • 5
  • 60
  • 64
0

i'd just delete the master branch and move the backup branch so it's name is now master.

git branch -D master
git branch -m backup master
Randy L
  • 14,384
  • 14
  • 44
  • 73