[linux] git push时需要输入user 和keyword

git clone的要是ssh链接!!!!

1、用户名和邮箱
git config --global user.name "name"
git config --global user.email "email"
2、生成ssh key (ED25519)
ssh-keygen -t ed25519 -C "<自定义内容>"
3、复制第二步的ssh,到gitlab的“个人设置-ssh公钥”里。
4、创建/root/.ssh/config
HostName xx.xxyun.com
PreferredAuthentications publickey
IdentityFile /root/.ssh/id_ed25519
或者
Host github.com
HostName github.com
User git
IdentityFile /Users/xin/.ssh/id_ed25519
然后
ssh-add /root/.ssh/id_ed25519
5、设置密钥权限
chmod 600 /root/.ssh/id_ed25519.pub
6、测试是否成功
ssh -T git@xx.xxyun.com
或者
ssh -T github.com

git checkout -b xin

git push --set-upstream origin xin

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 06:38:03       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 06:38:03       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 06:38:03       58 阅读
  4. Python语言-面向对象

    2024-07-12 06:38:03       69 阅读

热门阅读

  1. 【AIGC】GPT-4深度解析:自然语言处理的新纪元

    2024-07-12 06:38:03       23 阅读
  2. PyTorch中的CPU和GPU代码实现详解

    2024-07-12 06:38:03       25 阅读
  3. CSS实现从上往下过渡效果

    2024-07-12 06:38:03       28 阅读
  4. 力扣第228题“汇总区间”

    2024-07-12 06:38:03       22 阅读
  5. vue2修改组件样式

    2024-07-12 06:38:03       22 阅读
  6. MongoDB:基础语句及练习

    2024-07-12 06:38:03       26 阅读
  7. Xcode本地化全攻略:打造多语言应用的秘诀

    2024-07-12 06:38:03       25 阅读
  8. C++ const 关键字详解

    2024-07-12 06:38:03       27 阅读