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