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,553
  • 1
  • 21
  • 37
Starkers
  • 9,773
  • 16
  • 89
  • 149

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
  • 9,773
  • 16
  • 89
  • 149
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
  • 13,968
  • 12
  • 42
  • 73
0

Just point master to the same place as backup:

git checkout master
git reset --hard backup
Leif Gruenwoldt
  • 13,113
  • 5
  • 59
  • 64