Git for web development

Here we will discus on how to manage web development code and deploy to web server.

/web server dev & \ ---->  [git repo] ------->[web server staging]
\local git workdir/              |
                                 +----------->[web server prod]

Base on above diagram, there is 4 server involve:

  • dev – web server for development & local git work directory. Each programmer have their own development server, maybe running in virtual machine on their laptop.
  • stag – web server for staging before being push to production web server. This server will be tested by our test team and then also by client. Client will approve the changes to be push to production server. We have full control of our dev and stag server, so we can ssh to the servers.
  • prod – production web server. This server may not have connection ssh, usually only ftp transfer allow.
  • gitrepo – bare git repository. This git repo server will act as centralize git repo, where each developer/programmer will push their commit to the server.

Work flow

  1. Programmer will do coding on their own development server with local git workdir (dev). Do commit, etc.
  2. Then do pull and push their staging branch to staging branch at staging server.
  3. ….staging branch centralize git repo (gitrepo) via ssh connection.
  4. … prod branch to prod branch in gitrepo via ssh.
  5. gitrepo will do ftp to  prod server.

Configuration file

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s