Learning experience Summary (1)

Source: Internet
Author: User

Git introduction:

The management of Git is to build a storage repository locally, and all changes to the code are stored locally. That is, the code and the Management warehouse are will act. Do not want SVN into the client and server side. The client has only some simple warehouse information, and the real code and code changes are all stored on the server. The client generally can only get code files (only in general, if not to get the course is still possible). So this approach to git can reduce the burden on the server-don't worry about the server being broken or not being able to connect.

? git configuration:

The use of GIT commands, generally there are two forms, one is git back with parameters (such as: Git add), and the other is a direct minus connection of a command (such as: Git-add), followed by the use of the latter, so that the use of space to avoid problems.

Generate the key, user communication and decryption. If you accept the default setting, the key for 2048bits RAS is generated, and the private key and public key files are located at: ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub. The user needs to provide the server administrator with a public key (id_rsa.pub) that authenticates the user when synchronizing the repository. The user must keep the private key properly.

Configure the user name to use when generating patches and logs. The Git-config command with the--global option is to configure all user information, by default, only for the current user. The configuration information is written in the Git-config. If Git-config is added with the--global option, the configuration information is written to the ~/.gitconfig file. Because you may be involved in different projects with different identities, and multiple projects are managed with git, it is not recommended to use global configuration. Users can use other Git-config options to configure Git,--list can view the user's options. Such as

The use of Git

Command: GIT-INIT-DB executes this command in the directory we are managing to build the associated git database file. Let's start with a small example, as in the Hello folder there are two files, a C program and a makefile file.

Then execute the command described above:

After executing the above command, using "Ls-a", you will find a ". Git" file, which is a git repository for Hello small projects. Readers interested in this warehouse can go to the folder to continue the analysis. Next, we'll show you how to add files from your project to the repository and let Git do the version management. The command to add a file to the Git repository is git-add, which is not really a copy of the file to the Git repository folder. Just identify it in the repository to show that you want to manage it with git. The operation is as follows

? You can see that the add can be either a single file add or multiple files added together. Next is the submission and review of the project status. I believe that there is a point in the front to show that you have a little bit of git management feel it!

Learning experience Summary (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.