git configuration

git

gitlab has three permission levels

  • Private Private, only you or members of the group can access
  • Internal All logged in users
  • Public, accessible to everyone

Private

Private only allows ssh to push code.

  1. ssh-keygen -t rsa -C 'mark'Generate a pair of public and private keys through . If using the default name ~/.ssh, look for the id_rsafile under
  • Copy the file id_rsa.pubto the ssh configuration on git.

If you need to configure multiple git accounts at the same time, you need to ~/sshadd the following configfile , the content is as follows:

    HOST 192.168.1.212
        HostName 192.168.1.212
        Port	10022
        User	git
        IdentityFile ~\.ssh\test_id  #私钥的路径
    HOST git.oschina.net
        HostName git.oschina.net
        IdentityFile ~\.ssh\id_rsa_oschina
        PreferredAuthentications publickey
        User username2

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939565&siteId=291194637