Git initializes the build repository and the first commit

Source: Internet
Author: User

Which version of Git are you currently using? You can tell by the following command:

$ git--versiongit version 1.9.1

Before we start the git trip, we need to set up Git's configuration variables, which is a one-time job. That is, these settings make permanent records in the global file (. gitconfig) or system files (for example,/etc/gitconfig) in the user's home directory.

1. Tell git the name and email address of the current user, and the configured user name and email address will be used when the repository is submitted. The command is as follows:

$ git config--global user.name fuhd$ git config--global user.email [email protected]

Note: This command writes User.name,user.email information to the. gitconfig file in the user's home directory.

2. Set up some git aliases so that you can use more compact subcommands.

For example: Entering Git ci is equivalent to git commit, and entering Git St is the equivalent of git status. If you have system administrator privileges (for example, by executing the sudo command to get Administrator privileges), the command alias that you want to register can be used by all users, you can execute the following command:

$ sudo git config--system alias.st status$ sudo git config--system alias.ci commit$ sudo git config--system alias.co ch eckout$ sudo git config--system alias.br branch

Note: These commands will write information to the/etc/gitconfig file. Alternatively, you can run the following command to add a git command alias only in the global configuration of this user:

$ git config--global alias.st status$ git config--global alias.ci commit$ git config--global alias.co checkout$ git con Fig--global alias.br Branch

Note: This command writes information to the. gitconfig file in the user's home directory.

3. Turn on the color display in the git command output.

$ git config--global color.ui true

Note: This command writes information to the. gitconfig file in the user's home directory.


Git initializes the build repository and the first commit

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.