1

I have 2 branches

  1. master
  2. feature

I would like to completely blow-away the contents of master and replace them with feature branch. The expected result is, when I run a diff over the two branches after the operation, it should not return anything.

I have searched for many hours now and all the pointers still leave the diff output non-empty. It is possible that the question has been asked before, but believe me I have tried searching before bothering the community. Please point it out to me if it's a duplicate. Thanks in anticipation.

Prashant
  • 1,002
  • 13
  • 29
  • 1
    `git checkout feature && git branch -D master && git checkout -b master && git push origin master --force` – scrowler Oct 20 '15 at 20:54
  • Thanks! What does that do to the history associated with the **original** `master` branch? – Prashant Oct 20 '15 at 20:57
  • It'll wipe it out entirely, but that's what you mean by "blow away the contents of master" right? – scrowler Oct 20 '15 at 21:11
  • @RobbieAverill Looks like I have everything I need, including history. Thanks! If you would be so kind to add your original comment as an answer it will help those after me. – Prashant Oct 20 '15 at 21:18
  • 1
    glad you got it sorted, but there are probably plenty of answers in the question this one is a duplicate of that you could pass upvotes on to – scrowler Oct 20 '15 at 21:52

0 Answers0