I have 2 branches in Git, namely master and dev .
I’d like to convert dev branch’s content into master, that is to say I wanna ditch the state of dev, and change it to how it is like in master, how can I do that?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Resetting the state of one branch to be exactly the same as another – including the commit history – is known as a
resetin git, not a rebase. This is performed with the reset command.If dev is a published branch, then you probably want to retain the commit history. The most logical thing to do is to merge
masterin todevand then reset the tree to matchmaster‘s.E.g.
This will make sure that you won’t need to wind back history which is important if people are tracking the dev branch.