Install git to create a local repository

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.