git introduction, Installation and configuration

Source: Internet
Author: User

The usual Qaq, let's start with a brief introduction to Git:

Git is a distributed version control system that can be understood as a tool for managing code, controlling versions, and facilitating collaborative development of multiple people.

Git: Distributed version control system.

SVN, CVS: Centralized version-control system.

the difference between a distributed and a centralized type :

1) Centralized: In short, the repository is placed on the central server, want to modify the first from the central server to obtain the latest version, and then began to write code, the work is finished, and then push the code you wrote to the central server. Centralized version control system The biggest problem is the need for networking to work, the speed of good words also, encountered a poor speed, the submission code will become very slow.

2) Distributed: I think the biggest difference between distributed and centralized is that the distributed version control system does not have a "central server", everyone's computer is a complete version of the library, do not need to get a version of the network to push and so on, because the repository on its own computer, more convenient collaborative development, You just have to push your changes to each other and you'll see the changes.

Advantages of Git:

Security: First of all, the centralized version control system, assuming that the central server is out of the question, everyone has no way to obtain the latest version, greatly affecting the efficiency of the work. and distributed version control system is not the same, a person's computer problems, only need to copy from other people on the line.

Save point: Git's savepoint can track the source file, and can get the state of a certain point in time, you can merge the code submitted by many people at the save point, or you can fall back to a savepoint.

git offline: Git can commit code offline, GIT does not need to go online, it means git is faster than SVN and other tools, because SVN and other tools need to be online to operate, if the network environment is not good, the submission code will become very slow.

git branching and merging: Branching is the most significant feature of Git, because it changes the developer's development model. Simply put, git can switch between different branches in a single directory, and SVN and other versioning tools place each branch in a different directory.

Branching flexibility: Users can create, merge, delete branches at any time, multiple people realize different functions, can create multiple branches for development, then merge, this way makes development fast, simple and secure.

Git install:

1) First need to download, you can go to git official website: https://git-scm.com/or Https://git-for-windows.github.io (due to network problems the author here is not the latest version)

2) After downloading, double click to open, click Next directly;

    

3) Select the installation path (the default is C drive, see yourself used to)

    

4) Select the installation components: You can also choose directly by default.

Addition icons: whether to create desktop shortcuts;

Windows Explorer Integration: Browse the source code method, separate context browsing;

Associate. git* configuration files with the default text editor: whether the profile is associated, the configuration file mainly displays the style of the text editor;

Associate. sh files to is run with Bash: whether to correlate executed shell scripts;

    

5) Start Menu Shortcut directory: Set the directory name of the shortcut in the Start menu, or you can choose to create a shortcut from the Start menu no longer.

    

6) Set environment variables: That means you choose which command-line tool to use, by default.

Use git form git bash only: git bash command-line tool with Git;

Use of Git from the Windows command Prompt: Using the Windows System's commands-line tool;

Use Git and optional Unix tools from the Windows command Prompt: The above two must have (can understand the following warning);

    

7) Configure line end Conversion

Checkout Windows-style,commit Unix-style Line endings: convert Windows format wrap to Unix format and commit;

Checkout As-is,commit Unix-style Line endings: No matter what format, will be converted to Unix format and then submit;

Checkout As-is,commit As-is: Do not convert, check out what will be submitted;

    

8) Set up terminal emulator to use git Bash (default)

Use Mintty: Using the default terminal;

Use Windows default Console window: Using the Window defaults console windows;

    

9) Additional configuration options

Enable file system caching: Start the filesystem cache;

Enable GIT Credential Manager: make git credential Manager;

    

10) Wait quietly

    

11) Complete the GIT Setup Wizard

    

By the end of the GIT installation process, you'll find a git shortcut on your desktop and it's already in your Start menu options.

will also be configured in the right mouse button

  

The next step is to configure the user name and mailbox.

Right-click Git bash here or start choosing Git bash; Enter:

git config--global user.name "xxxx" to enter your username;

git config--global user.email "xxxxxx" Enter your mailbox;

  

User Name Mailbox role: We need to set a username and mailbox, which is used to upload the local repository to GitHub and display the code uploader on GitHub.

git introduction, Installation and configuration

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.