This tutorial describes how to setup a git server if you have a similar setup like mine. I have a live server running linux and I use windows & linux for development. I’ll keep it as brief as possible and let you figure out the rest. If a part isn’t clear, just ask. Here is a brief overview of what we’ll do.
- Setup Gitosis on your linux server.
- Setup a git client for your windows box
- Clone Your Repository on your Windows Box
- Commit, Push and Pull
- Deploy Online
Setup Git on Windows
Download and install Git from msysgit
Be sure to download the full version if you’ll like to use the Git GUI eg. Git-220.127.116.11-preview20100309.exe
- Startup Git Bash
# ssh-keygen -t rsa
Do not add a passphrase.
- Upload your public key to your gitosis-admin
Clone Your Repository
Enter Source Location
Using Git Bash
- # cd /install-dir
- # git clone git@YOUR_SERVER:YOUR_PROJECT.git
Committing & Pushing Changes
- Start Git GUI
- Click Open Existing Repository and select your repository. Alternatively, you can select your repository from the list under Open Recent Repository. You can also create a Desktop shortcut to your repository from Git GUI. Once you have opened your repository, click on the Repository menu and click on Create Desktop Icon
- Click on Rescan. This should show all the modified files in your repository.
- Select all the files in the Unstaged Changes list and click on the Commit menu and then Stage to Commit.
- Enter you Commit Message. For tips on how to write good commit messages goto http://www.spheredev.org/wiki/Git_for_the_lazy#Writing_good_commit_messages
- Click on Sign Off
- Click on Commit
- Clone your application in your webserver root.
- To update your online copy after making updating the central repository, just
# git pull