[Tool to] the basic use __ git

  • Preface
    we already know, in front of git is a distributed version control tools distributed implementation, the code can solve a lot of risk management, and distributed implementations, which is built on the basis of two points, that is, git not only it has a centralized server to do the central code repository. and that each machine there is also a local repository for local project management. this will reduce a lot of risk.

  • git version control implementation principles

git is a distributed version control system, it is mainly formed of a version control system and a local version of a control system of a combination of a remote repository.


8067684-bafcc6d638da9e01.png
Pictures .png

git mainly consists of several parts work area, staging area, the local repository, a remote repository.

8067684-ae2aa2551847ade3.png
Pictures .png

Use git version for process control.

8067684-13191e8cb54dce16.png
Pictures .png

  • Create a public establishes a connection with the remote repository through git bash gitee tool

We all know that only after configuring the public through git, to access remote warehouse, will deploy up the project.
Code provides a cloud-based service git ssh protocol, before accessing the repository using ssh protocol, also you need to configure the account / warehouse ssh public key

sshkey generation:

Ssh public key generated using the following command in command-line tool gitbash:

ssh-keygen -t rsa -C "gitee.com"

Enter the command, follow the prompts to complete the three carriage returns, generate ssh key, by looking at the ~/.ssh/id_rsa.pubfile contents, access to your public key.

8067684-e55b5b587f2f586c.png
Pictures .png

Use the following command to view your public key file:

cat ~/.ssh/id_rsa.pub
8067684-37a78d9ca081457f.png
Pictures .png

git of ssh key is stored by default in its ~ / .ssh directory, we enter the directory and lists where you can view the contents of your own key to the case:

Check the following command:

$ cd ~/.ssh
$ ls
8067684-6b8e57f8db4226b0.png
Pictures .png

Which .pub file is your public key. Then you can open the file to see the view through the above commands directly.

The public part of the right to copy down ssh, cloud account login code, find the key management settings, add the public key, add it, you can achieve a secure connection between local and cloud code.

8067684-e036803da3fbc2f1.png
Pictures .png

Of course, you can also find directly under .ssh directory, to open the public key file in Notepad.

8067684-f9cfcedd89bb6e71.png
Pictures .png

Updated
2019-6-1
11:17

Guess you like

Origin blog.csdn.net/weixin_34088598/article/details/90958287