英文:
How to completely replace dev branch into master? (Without having to resolve conflicts)
问题
My master
branch is very out of date. Like 100+ commits behind dev
, it is no longer needed anymore. If I merge with dev
, there are many conflicts I don't need to resolve. Plus, I have created a master-old
branch just in case. How can I make dev
as my master without having to resolve conflicts.
I tried:
- Destroy
master
and create it again fromdev
(not allowed by GitHub) - Rebase (It needs to resolve conflicts)
- Flag --theirs (not sure how to use it)
英文:
My master
branch is very out to date. Like 100+ commits behind dev
, is not longer needed anymore. If I merge with dev there are many conflicts I don't need to resolve. Plus, I have created a master-old
branch just in case. How can I make dev
as my master without having to resolve conflicts.
I tried:
- Destoy
master
an create it again fromdev
(not allowed by github) - Rebase (It need to resolve conflicts)
- Flag --theirs (not sure how to use it)
答案1
得分: -1
最简单的方法:
git checkout master
git reset --hard dev
git push --force
英文:
The easiest way:
git checkout master
git reset --hard dev
git push --force
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论