Version Control – How to Manage Legacy Code in Git Branches

gitversion control

I have a website application which was developed and versioned using Git. A new version of the site was developed from the base of the older site.

The 'legacy' site lives in master and the new version of the application is now in international.

What techniques or processes can I employ to better manage this discrepancy?

Ideally, I would like the 'legacy' site to live in a legacy branch or similar, and our currently deployed code base to be tracked in master.

Can I just rename the branches? What impact would that have? I assume that I would need to rename all the remotes and anything which was pulling from those remotes?

Or should I think about forking the repo and then cleaning up the new site's repo?

Perhaps I could use tags to manage the divergence?

Best Answer

Create a new branch called legacy from the current master.

Then merge your international branch into master and go from there.

Be sure to push your changes to any remote repositories you need to.

You can always merge changes from master to legacy, or from legacy to master as needed.

Related Topic