Setting up a GIT Repository

Image of Setting Up GIT

This write-up is a guide to setting up a repository for configuration management.  The tutorial is based on GITBeanstalk, and a Windows environment using WAMP for local hosting.  The GIT software provides the source code configuration management.  Beanstalk hosts your development environment.  Beanstalk is a favorite because it streamlines the whole process and has a nice user interface.  Deploying an update to a live site is an easy button push once it has been configured.  Beanstalk offers a cost effective package for freelancers.  A free alternative to Beanstalk is Bitbucket.

This write-up is essentially a checklist for setting up a new site that makes it easier for developers to use best practices in configuration management.  More documentation on each of the technologies is available on their respective websites.  Here are the steps:

  1. Create a directory with your files inside of the www directory, which is under the WAMP directory.  This is when you are using local or virtual hosting.  This is your local repository.
  2. On WordPress repositories,create a text file named “.gitignore” containing  “wp-config.php” and place it in the root.  GIT will ignore this file so the local and server configuration settings stay intact.
  3. Log into your GIT hosting provider (Beanstalk or equivalent).    (Note…you will need to use your login information again.)
  4. Create a repository.
  5. Copy the URL address for it that is provided after the setup is complete to the clip board.
  6. Open a command prompt in windows and navigate to the local directory.  Alternatively go to Windows and open GIT Bash (if you want Linux based commands).
  7. Enter “git init”.    You should receive this message: “Initialized empty Git repository in  yourURL“.
  8. Enter “git remote add beanstalk https://github.com/user/repo.git (substitute your URL that Beanstalk gives you for the one shown here in italics).
  9. Enter “git add .
  10. Enter “git commit –m “initial setup of GIT
  11. Enter “git push beanstalk  master
  12. Setup Deployment inside of Beanstalk to streamline updates from the development environment to the production server inside of Beanstalk.  There are a few options for the Deployment feature including FTP.

Comments are closed.