Answer the question
In order to leave comments, you need to log in
How to switch a commit in a git branch?
There are two branches: master and prod. In prod, a new version was developed, master - the old version and only hotfixes. Now I need the master branch to be identical to the prod branch. Merge cannot be done, an incredible amount of conflicts. How to switch the master branch to the same commit as prod correctly?
Answer the question
In order to leave comments, you need to log in
git checkout master
git branch -m old-master //переименовали master на всякий случай вместо удаления
git checkout prod
git checkout -b master
git push origin --all --force
Maybe this is incorrect, but the first thing that comes to mind is to branch from the master (in order to save its state, if necessary) into a separate branch, for example, old, drop the master itself, and then branch from prod to the new master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question