8

I am new to git and looking for the most efficient way to setup development and production environment with git.

I develop locally on some projects, say:

project1.local
project2.local
project3.local

When I am ready I push the changes to the server, where beta tester can work with it:

beta.project1.com
beta.project2.com
beta.project3.com

Only if betatest succeeds I would like to push the changes to production domain:

www.project1.com
www.project2.com
www.project3.com

I do understand how to connect project1.local and beta.project1.com. However, I do not really understand how to setup the connection between beta.project1.com and www.project1.com to push tested features into production.

Is git right for me?

2 Answers 2

6

Check "A successful Git branching model" to do more or less what you want.

In git you can have multiples repositories (git remote --help). So, in production you can have the repositories pointing to beta, and pull the changes from there. In beta, you can have both, production and development and pull changes from development and push them to production. For each case, you should handle branches, in whose case, the link given should give you enough ideas.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, it sounds like exactly what I am looking for.
0

You can use a hook, or a continuous integration tool, that would trigger different deployment target depending on which branch gets updated.

You would have a central repo, with beta and production branches. When you want to release to beta, commit it the beta branch, and push to the central repo. Then the hook or script, recognizing that the beta branch has been updated, takes action and deploy accordingly to the beta server.

Same thing for production commit.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.