Replace local merge changes

master → completely messed up, my first time using gitmergetool

backup → works great.

How can I combine backupwith master and make it a backuppriority for everything, including files that exist in master, but not in backup, that will be deleted.

I started the gun git reset --hard <hash where everything was peachy>and returned the project before trying to drain. So how do I go about merging? I don’t know where the conflict came from. I had to devote myself to the owner, but I do not remember this.

I thought it would be easier to delete masterand then rename backupto master, or checkout -b mastershould I try to merge?

+4
source share
3 answers

, , , , - , .. :

git checkout backup
git reset --hard <hash where everything was peachy>
git checkout master    
git merge -s recursive -Xtheirs backup
+1

master backup, master.

git branch -D master
git branch -m backup master
0

Just point the wizard to the same place as the backup:

git checkout master
git reset --hard backup
0
source

Source: https://habr.com/ru/post/1538987/


All Articles