How to reset develop a branch for management

I have develop and master branches, the develop branch is now messed up, and I would like to reset and make it as a copy of my master . I'm not sure if combining master into develop will make them the same. after trying to merge, I got a lot of conflicts, I decided to use them:

 git checkout develop git merge origin/master //got many conflicts git checkout . --theirs 

enough for the develop branch to be an identical copy to master ?

thanks

+8
git version-control branch
source share
2 answers

If you want develop be identical to master , the easiest way is to simply recreate the pointer:

 git branch -f develop master 

Or, if you have already chosen develop :

 git reset --hard develop master 

Please note that both of these options will get rid of any history that develop was not in master . If this is not all right, you can save it by creating a commit instead that mirrors master last state:

 git checkout develop git merge --no-commit master git checkout --theirs master . git commit 
+12
source share

if you just want them to be the same.

then

 //from Develop and assuming your master is up to date with origin/master git reset --hard master 
+16
source share

All Articles