Strictly Programming

Using git to deploy a web app

Posted in git by sqllyw on 02/19/2012

If you are the only developer of a web app, you should use git to deploy it, save time.It is very easy, steps:

1) put git repository into your folder of app if you have not yet done this:
git init
git commit -a -m ‘initial import’

2) ssh into your web app folder in the server, do a clone:

git clone ssh://username@my_machine_ip/path_to_your_app

that’s it, your app is already deployed in the web server, run it

now, if you edit something in the web server and wish the changes be reflected in the development machine, simple:

1) in your development machine’s app folder do:
git pull ssh://username@web_server_ip/web_app_folder

this sync the development version to the deployed one.

if you have made some changes to the copy in the development machine and want to update the server for that, just do:

1) ssh into web server, in the wep app folder do:
git pull

that’s it.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: