Installing GIT on locally : Git is a open source project version control system. Before you start using Git, you have to make it available on your computer. Even if its already installed, its probably a good idea to update to the latest version. In Ubuntu OS you need to run following command to install the git.
$ sudo apt-get update
$ apt-get install git
Create Repository :
Initialinzing repository in local directory :
$ mkdir <project-name>
$ cd <project-name>
$ git init
The git init command will create a new repository inside the selected folder.You can also convert an unversioned project to git repository using git init command. Actually git init command create a .git subdirectory inside the project root, this subdirectory contains all the metadata about the project.
If you want to create the repository from outside the root folder then you can run following command :
$ git init <path-to-directory>
In the above command you can replace with your project root path which you want to versioned or track for changes.
Now what if you want to share your repository to multiple users.If you create your repository from git init command the repository will contain working copy also. But if there are multiple users of your project who want to changes files and commit.So to share your repository to other users you need to create a bare repository. For creating a bare repository you need to run following command :
$ git init --bare
The --bare option will create a repository that doesn't contains the working directory of project.
Git Configuration :
Your identity : The first thing you should do when you install Git is to set your user name and e-mail address. This is really important because every Git commit uses this information: