Ivor O’Connor

December 16, 2012

Easy Git Setup

Filed under: Uncategorized — ioconnor @ 5:44 am

Every new project requires a few steps to setup the git repositories and put the information on the webserver. Usually you want to do your work locally in your own git repository and then push the changes to the server’s git repository and to the website. I’ve noticed all the guides on the internet show conflicting steps on how to do this. Furthermore they all have you entering the steps manually on the local side, then logging in the remote side, and then again on the local side. In various permutations. It’s all very confusing. So I put everything in a single bash file that runs once on the local side. It sets up the local git directory. The remote git directory. And it publishes the results to the website. There is no fussing about on the remote web server because everything on the remote server is done by this local bash script. I have seen another script written in python that can be run on the server to set up the remote side but why mess with the remote side at all when everything can be done in bash locally!

A future todo item will be to setup multiple remote web servers at once. So a single push updates every web server. I see that as another script that this script can call when complete or called from the CLI everytime there is a new site to be added.

I used this script to setup a new site last night by typing something like (changed the names for obvious reasons but hopefully didn’t introduce any typos):
./setupgits.bsh   /home/ioconnor/projectx   ioconnor@ioconnor.com   /home/ioconnor/git/projectx.git   /home/ioconnor/public_html/projectx

setupGit

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Create a free website or blog at WordPress.com.

%d bloggers like this: