Installation
Since I'm using Ubuntu, it's easy to install, input:sudo apt-get install git
If it is a different Linux version, you can install it directly from the source. First download the source code from the GIT official website, then unzip ./config
, make
then sudo make install
Enter:, these several commands to install just fine.
As for Mac and Windows install git, in Liaoche's official website has the detailed introduction, I do not say more here. His website address can be found in the order of learning.
To create a local version library
The so-called Repository, is a directory that can be managed by git, the directory of each file modification, deletion, git can track, so that any time can track history, or at some point in the future can be "restored."
Creating a repository is as simple as CD to directory as repository, and then type:git init. Since then, the directory is more than one .git
directory, this directory is git to track the management of the repository, do not manually modify the files in this directory, or change the mess, the Git repository to destroy.
The startup repository is empty and needs to be added to the file. Note that even if the directory as a repository is originally non-empty, the files in that directory are not automatically added to the repository after initialization and must be manually added.
git Add file name
Git commit [-M "comment"]
You can add all the files first, then commit once, and the contents of [] After commit are optional, as comments for this submission. It is better to add, and later useful.
Install git to create a local repository