1

i have a doubt with my git repository.

i have a version A (master is actually here) and a version B (branch version_B) of a project. Version A is a old and maintenance. Version B is a upgrade of A (we had to delete much files, change structure and add other files to respect the newest version framework).

So now it's time to move the branch master to reference Version B because because the version A is out of the date (just for bug fixing)

What is the best way (secure) to do that ? Merge/Reset ?

Lucho82
  • 150
  • 2
  • 10

1 Answers1

0

move the branch master to reference Version B

That is what reset does. Checkout master and reset it hard to version_B:

git switch master
git branch temp 
git reset --hard version_B

This will cause version_B and master to become one another. You may omit the second step if you are willing to lose the whole history of the outdated master. You may have to force push so prepare your team in advance.

matt
  • 515,959
  • 87
  • 875
  • 1,141