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
Tutorial for Setting Up Gitosis
Setup Git on Windows
Download and install Git from msysgithttp://code.google.com/p/msysgit/
Be sure to download the full version if you'll like to use the Git GUI eg. Git-1.7.0.2-preview20100309.exe
- Startup Git Bash
Run# ssh-keygen -t rsa
Do not add a passphrase.
- Upload your public key to your gitosis-admin
Now that you have git installed, you will need to download your working copy of the project. Your working copy [WC] is what you will be working on so I suggest that you create it in a folder in your webroot. The following steps will help you achieve that.
Using Git GUI
Enter Source Locationgit@YOUR_SERVER:YOUR_PROJECT.git
Target DirectoryC:/MY_PROJECT_DIR/
Using Git Bash
- # cd /install-dir
- # git clone git@YOUR_SERVER:YOUR_PROJECT.git
Now that you have your working repository and you have made modifications to the project, its time to commit (update repository with changes) and push (upload to central repository).
Using Git GUI
- 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
- Click
on Push
- Clone your application in your webserver root.
- To update your online copy after making updating the central repository, just
# git pull
No comments:
Post a Comment