I. Pre-preparation for installation
1.git Client (1. The private key and the public key that are required to verify the Gitlab server and local git transfer to each other 2. Use Git to commit and push code directly in idea, and of course you can commit code with Sourcetree)
2.sourcetree client (1. Pull remote server code to local 2.push local code to remote 3. Create a branch to resolve conflicts in the commit code)
3.gitlab account (General company configuration, with your own mailbox) (1. Set up a remote branch that can be traced 2. Modify activity for local and remote code detailed display 3. Cloud repository, store code)
The bottom line is that Gitlab stores the remote code, and Git is a bridge between local code and remote code, but in the form of a command, Sourcetree is the client that turns git into a visible one.
Two. Basic ideas and illustrations:
1. Using GIT bash to generate public and private keys
(using the GIT bash command to generate the private and public keys needed to verify the Gitlab server and local git transfer to each other, the public key is used to configure the Gitlab, the private key user configures Sourcetree.) )
Open git bash and enter the following command:
(1) Set the user name and email for git:
$ git config--global user.name "test"
$ git config--global user.email "[Email protected]"
(2) process of generating SSH key:
1. See if you already have an SSH key: CD ~/.ssh
If there is no key then there will be no such folder, there is a backup to delete
2. Generate key: (Note that there is no space between SSH and Parameters!!!) )
$ ssh-keygen-t rsa-c "email address"
Press 3 to enter, the password is empty.
The following 3 files are generated in the. SSH folder at this time,
2. Configuring the public key in Gitlab
Login Gitlab, "project setting" SSH, add it
The private key of the 3.sourceTree configuration, corresponding to the Gitlab public key
Open Sourcetree, click Tools "Options" general, set the path of the public key. Note Client selection: OpenSSH
This will allow the configuration to succeed!!!
--------Gorgeous split-line------
3. Pull the remote code to the local repository
In Gitlab, look for the address of the warehouse that needs to be pulled, as follows:
In Sourcetree, "Clone/New warehouse, fill in the remote and local warehouse path, add can, then directly pull the warehouse."
In this way, you can immediately replace the code in Sourcetree.
bingo~
over~
Sourcetree and Gitlab configuration plots