How to Use git -- (1)

Source: Internet
Author: User
Tags how to use git

1. Git and GitHub

Git is a free and open-source distributed version control system for agile and efficient processing of any large or small projects.

GitHub is a website that provides users with the GIT repository hosting service. It is an open-source code library and version control system. You can find a lot of open source code on GitHub for easy learning.

Ii. Install git (for Windows)

1. Download http://git-scm.com/download/ on this website

2. Keep going next. (PS: during this period, you can customize the installation path .)

  

3. After the installation is successful, you can find the GIT logo on the desktop. Double-click it and a black box will pop up.

   

 

4. Start configuration.

Git config -- global user. Name "your name"

Git config -- global user. Email "your email"

Note: The information name configured here is the user name on GitHub, And the email is the one displayed on GitHub. (Currently I use this method), but you can also set different user names and emails for different repositories.

Skills1: You can enter git config -- list to check whether your configuration is correct.

Skills2: You can also use git config user. Name and git config user. Email to view your username and email settings.

  

5. You can manually create a folder or create a folder by running commands in git. The following is a command to create a folder:

  

Command explanation: CD/drive letter #### convert drive letter

Mkdir file name #### create a folder

PWD #### display the current directory

6. Change the Created directory to a repository as follows:

  

Command explanation: git init #### this is an empty repository. Now, there is one more in the directory. git Directory, which is a hidden directory, used to compile the total version library. Therefore, do not manually repair the files in this directory.

 

7. Add a file to the repository, as shown in:

  

Command explanation: git add file name ### use this method to add files

Git commit-M "Enter the submission description" #### enter the description for this submission. You can enter any content, but entering meaningful content can help you view the history.

Note: You can add multiple continuous add files. You can commit multiple files at a time.

  

To be continued ......

       

 

 

  

How to Use git -- (1)

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.