0

Have been using git for a couple of weeks and things were going swell. Until I was working on an outdated branch that couldn't be merged and then when I did everything broke.

I have since created a new branch 'new master' and made sure that this one includes all the changes, all the branches and is the current newest (working) version.

My aim now is to delete all the branches and make this 'new master' the new master branch.

How should I go about this without the chance of losing everything?

Also, if do this. On my local machine I should be doing git fetch -all? That should give me the new master and set me up to carry on as I was?

Lovelock
  • 6,609
  • 15
  • 71
  • 162

2 Answers2

0

You probably need to force push the new master branch. If you are 100% sure that the new master is really the only branch you want to have then you can git push -f origin master, please be aware that all local changes need to be reset to new origin git reset --hard origin/master

Tomáš Weiss
  • 239
  • 2
  • 5
0

First you need two step which have already answered on this site

[STEP 1]

Change the current branch to master in git

[STEP 2]

How can I delete all git branches which have been merged

Community
  • 1
  • 1
Imran
  • 2,688
  • 4
  • 23
  • 38