Currently my website (production server) already have a lot of code in it. And now I want to start using Git for my projects and setup a staging server for my team. Can anybody give me any advise?
Here is the picture in my mind:
Production - Production server which already have codes ↑ Staging - New staging server, will install Trac too ↗↙ ↖↘ Developer1 Developer2 - Local development
My question is, how should I start?
Here are some steps in my mind:
git init
in production server (is this safe?) clone
the repo from production to staging serverclone
the repo from the staging to their local machinepush
files to the staging server after finish changingpush
everything to the productionDoes this work flow makes sense, or there are some better way to do it?
What if I only want to change one file?
Does origin/master has anything to do with it in this process?? Who is the origin? am I going to end up having multiple origins??
Also, when should a developer use branch
in this case?
Typical Workflow are as followsGet local copy of code. Create a branch. Edit files. Add and commit changes to local machine. Get back in sync with changes commited by others.
It's better to use master branch only for Production and development branch for Staging. Each developer should create local branch to add new features and then merge with development branch. If you're new to a git, try to use - http://github.com/nvie/gitflow There is also good picture describing git branching model - http://nvie.com/posts/a-successful-git-branching-model/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With