Idea + git + gitlab


Gitlab installation pit

502 error code and solution to access stuck


Gitlab is too laggy for memory, and my server Centos 7+2 core +2G memory, frequently reported 502 errors, and access is also very stuck. The reason may be that there is too little available memory.
#Free – M view available memory


We can see that there is not much free. The solutions include expanding memory or using virtual memory. Let’s see how to use virtual memory.

1. Add swap exchange file

1) Create a swap file with the DD command

dd if=/dev/zero of=/home/swap bs=1024 count=2048000

In this way, a partition file of / home / swap is created, which is 2G in size and can be multiplied by itself.

2) Make it into swap format file:

mkswap /home/swap

3) Then use the swap command to mount the file partition to the swap partition

swapon /home/swap

Let’s take a look with the free – M command and find that there are already swap partitions.


2. To prevent the swap partition from becoming 0 after restart, modify the / etc / fstab file

vi /etc/fstab

Add the

/home/swap swap swap default 0 0

In this way, even if the system is restarted, the swap partition still has a value.

Gitlab and git use SSH key

Using SSH key allows us to add a key to the project to pull, push and other operations without frequent password input. (SSH)

1、 Git configuring global users

git config –global“your name”
git config –global user.emal=“your email”

2、 Generate SSH key

ssh-keygen -t rsa -C “[email protected]

Then, Windows users can see the generated key in the folder of C: / / users \ \ user name. SSH


3、 Adding SSH key to gitlab

Gitlab添加ssh key

The ID that will be generated_ The content is copied and pasted to the key. Generally, the title is not filled in. The mailbox filled in when the key is generated will be used automatically. (SSH should be used instead of HTTP when cloning code repository)

Idea uses git for code version management

1、 Install Git

Learning with one mind

2、 Idea configuration Git


choice Git.exe Path, click test to test whether it works normally.


3、 Idea uses git to import projects quickly


4、 Common operations

Common shortcut keys:


Here is the article about idea + git + gitlab detailed tutorial. For more information about idea + git + gitlab, please search previous articles of developer or continue to browse the following articles. I hope you can support developer more in the future!