What is a repository? Repository also known as the Warehouse, English name repository, you can easily understand a directory, all the files in this directory can be managed by git, each file modification, deletion, git can track, so that any time can track history, Or you can "restore" at some point in the future.
Therefore, it is very simple to create a repository, first of all, select a suitable place to create an empty directory:
$ mkdir learngit$ CD learngit$ pwd/home/exbot/learngit//login user is Exbot
This warehouse is located in/home/exbot/learngit
The second step is to git init
turn this directory into a repository that git can manage by command:
$ git initinitialized empty git repository in/home/exbot/learngit/.git/
Instantly Git has built the warehouse, and tell you is an empty warehouse (empty Git repository), careful readers can find the current directory is a directory of more than one, .git
this directory is git to track the management of the repository, it's OK don't manually modify the directory inside the file , or change the mess, the Git repository to destroy.
Attention:
You don't have to create a git repository in an empty directory, and it's also possible to choose a directory that already has something. However, it is not recommended that you use the company project you are developing to learn git, otherwise you will not be responsible for any consequences.
Git Easy Guide Three--Create a repository