Git

git distributed revision control and source code management. The goal of this article is to easily get a git repository up and running pushing and pulling, and making the installed version of git comparable with (the majority of) http://git-scm.com/book/en/.

Git was developed by Linus Torvalds for use on the Linux Kernel, and other Open Source projects. According to a talk he gave for Google, he was searching for an SCM and used three criteria which brought the number of adequate systems to zero:


 * 1) Must be distributed.
 * 2) Must be fast.
 * 3) What you get out MUST BE EXACTLY what you put in, or you get an error.

Since there were no satisfactory options, he wrote Git.

Installation
Install :

Tutorials
There are lots of really good tutorials on git. Let's not re-invent the wheel. Here are some I know and like, but any search engine will show you lots of examples.


 * 1) http://git-scm.com/doc
 * 2) Official documentation
 * 3) Video tutorials
 * 4) http://try.github.io/levels/1/challenges/1
 * 5) Free, good basic first-time tutorial
 * 6) https://www.codeschool.com/courses/git-real
 * 7) The first section is free, the rest are paid.
 * 8) A really straightforward tutorial

Local
If you're the only one using your project, or if you're creating something which will be shared in a distributed way, then you should start on your workstation. If you intend to have a central server which everyone uses as the "official" server (e.g. github) then it might be easier to create an empty repository there.

This section, describes creating the repository on your workstation.

Here's an example of creating a project on your workstation:

You're done. You've created a local repository. It's in the folder, so don't delete your  folder unless you mean to lose everything.

Now, let's say we make some edits:

Git needs you to specify that we want to keep the changes we just made, so we need to add it before we commit:

Look to the tutorials to go further.

Server
In this section will cover setting up a git server for remote project management through SSH.

Note: The git server is only necessary if you intend to have an unauthenticated read-only server for people to get your code from. See here: http://git-scm.com/book/en/Git-on-the-Server-Git-Daemon

If you're not sure, then skip this section.

Initial Setup
Start by creating the needed group, user, and home directory. The user uses the git-shell to prevent normal shell access.

Edit to change user from "nobody" to "git" and start the daemon.

SSH Keys
SSH is the prefered method to handle the secure communications between client and server. For Git to work properly, you must have private/public key logins enabled and all client public keys added to. For more information and instructions on how to enable, create, and share keys, please see the SSH - Passwordless Authentication wiki page.

Create a Repository and make the First Commit
On the server:

Become user git to make sure all objects are owned by this user

Create a bare repository

On a the client station:

Common Commands
Clone a repository:

Gui Repository Management
Git ships with a tk gui.

External resources

 * git flow documentation, client side scripts to make git repository management a snap.
 * Git Handbook
 * Git Homepage
 * Git Wikipedia Entry