If you want to make develop
be identical to master
, the simplest way is just to recreate the pointer:
1 2 | git branch -f develop master |
Or, if you already have develop
checked out:
1 2 | git reset --hard develop master |
Note however that both of these options will get rid of any history that develop
had which wasn’t in master
. If that isn’t okay, you could preserve it by instead creating a commit that mirrored master
‘s latest state:
1 2 3 4 | git checkout develop git merge --no-commit master git checkout --theirs master . git push -f |
Reference: https://stackoverflow.com/questions/18436680/how-to-reset-develop-branch-to-master/18436724
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.