Friday, June 1, 2012

Setting Up Git Server

In Linux, just install using the appropriate package manager.

In CentOS: yum install git
  1. Create the user account, setup public key authentication, and then login as the user
  2. Create a folder for repositories e.g. mkdir repo
  3. Create a folder for the repository you want to add: e.g. mkdir project.git
  4. Go into the folder, and run "git init --bare"
This is all that's needed on the server.

On the client from which to share the code:
  1. Create a repository i.e. git init
  2. Add and commit some files
  3. Setup remote e.g. "git remote add origin username@serveraddr:repo/project.git"
  4. git push origin master
References

No comments:

Post a Comment