Chris
Chris

Reputation: 545

Git: One Repo, Three Web Sites?

I have three web sites on my server: DEV, TEST, and LIVE. All three contain the same files and directories, and all three were using a git repo that is now defunct. I have created a new repo and pushed the contents of DEV to it. I then cloned this repo to my local machine, where development for all three sites takes place. So far, so good.

My question is: How do I make my TEST and LIVE sites use this same repo? Do I just reinitialize those sites and add my new repo as the remote origin? I'm not sure how Git will react, since there are already files and directories present, even though they're the same. (I have .gitignore files in each site that take care of any files that SHOULD be different.)

Upvotes: 0

Views: 40

Answers (1)

Erik Dannenberg
Erik Dannenberg

Reputation: 6086

Should be enough to just update the remote url:

git remote -v
git remote set-url <remote name> <new url>
git remote -v

Upvotes: 1

Related Questions