How Git creates a local library and submits files to a local library

Source: Internet
Author: User
Tags version control system

Creating a repository is very simple, start by selecting a location that you want to place and creating an empty directory:

(with Windows Git Bash, this tool commands a similar operation to Linux)

$ mkdir gitrespository//Create Directory

$CD gitrespository

$git init//Initialize this directory to an empty local repository

Then we create a TXT file in the Gitrespository directory. Readme.txt, the contents are as follows:

Git is a version control system.

Git is a free softsware.

Be sure to put this file in the Gitrespository directory (sub directory is also OK), because this is a git repository, put somewhere else, git can't find this file

$git Add Readme.txt//adding files to the Warehouse

$ git commit-m "wrote Readme file"//Submit file to Warehouse
[Master (Root-commit) 2141c92] wrote Readme file
1 file changed, 2 insertions (+)
Create mode 100644 readme.txt

Git commit-m The following input is the submission instructions, you can make any content, of course, preferably by meaning, so that you can easily from the history of records to find Change records

Why does git add a file that requires add,commit in two steps? This is because commit can commit many files at once, so you can add different files multiple times, such as:

$git Add File1.txt

$git Add File2.txt

$git Add File3.txt

$git commit-m "have commited add 3 files"

How Git creates a local library and submits files to a local library

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.