user2143356
user2143356

Reputation: 5597

How do I use GitHub to create version 2 of a repository, but keep both versions active?

I have a repository with a small group of files in. This is a script that is used by a number of live websites.

I now want to create 'version 2' of that repository, or make updates to it (e.g. version 2), but the key thing is that I will want to introduce version 2 only to a small number of the live websites initially.

Would this simply be a case of creating a 'version 2' branch? However that doesn't sound right as I may want to keep both versions around forever and I see a 'branch' as an arm for developing a feature - and then to merge in to the master when completed.

I would certainly want some websites to be using the tried and tested original, whilst some test the new one.

Also, how would I ensure the web server had the files from the required 'version'? This might mean setting something so Git on the web server downloads that version, or is there a better way?

Upvotes: 0

Views: 803

Answers (1)

Michael Anderson
Michael Anderson

Reputation: 73470

IMO, It's fine to use a branch for an alternate version. So I'd just do exactly what you suggest - create a branch.

To get the right version on the "other" web servers a simple git checkout version2 will get you onto the right branch (Assuming you've got a full copy of the repo on each web server - if you're deploying in some other way, you'll need to give us details...)

Upvotes: 1

Related Questions