访问你的GitLab账户:https://gitlab.com/
点击右上角的设置按钮,在下拉菜单中选择“Settings”,该选项会在选择图标(我的个人资料特定的白狐狸形象)后出现。
点击右上角的设置按钮,在下拉菜单中选择“Settings”,该选项会在选择图标(白狐狸形象)后出现。
添加/粘贴SSH密钥。
如何生成SSH密钥:下载gitbash或putty:
下载gitbash / putty后,按照以下步骤操作:
Generate a new ED25519 SSH key pair:
ssh-keygen -t ed25519 -C "email@example.com"
Or, if you want to use RSA:
ssh-keygen -t rsa -b 4096 -C "email@example.com"
It will generate the key in => C:\Users\yourname.ssh directory.
Copy the public key and paste in the gitlab location:
ssh-agent $(ssh-add C:\Users\youname\.ssh\id_rsa; git clone git@gitlab.com:xyz/SpringBootStarter.git)
前往https://gitlab.com/profile/keys。
如果您是新用户,则每个项目页面的顶部都会显示一个横幅。
在您的个人资料中添加SSH密钥后,您将无法通过SSH拉取或推送项目代码。
但是,您可以忽略此警告。
首先,您需要打开终端,然后输入
mkdir -p ~/.ssh
echo public_key_string >> ~/.ssh/authorized_keys
chmod -R go= ~/.ssh
chown -R shabeer:shabeer ~/.ssh
ssh-keygen or ssh-keygen -t ed25519 -C "mail@example.com"
xclip -sel clip < ~/.ssh/id_ed25519.pub
~/.ssh/gitlab_rsa.pub