生成、查看和获取SSH key

  1. 检查本地是否存在ssh key
    ls -al ~/.ssh
    如果存在,则会显示信息
    在这里插入图片描述
    或者 cat ~/.ssh/id_ed25519.pub

  2. 生成新的SSH key
    ssh-keygen -t ed25519 -C “your_email@example.com”

    ** ed25519 是文件名,该命令会生成id_文件名.pub的文件

  3. git 全局设置
    git config --global user.name “youremail@qq.com”
    git config --global user.email “”

  4. 克隆仓库
    git clone https://codeup.aliyun.com/61db90e2f9a895xxxxxxx/My-Demo.git
    cd My-Demo
    touch README.md
    git add README.md
    git commit -m “add README”
    git push -u origin master

  5. 已有文件夹或者仓库
    cd existing_folder
    git init
    git remote add origin https://codeup.aliyun.com/61db90e2f9a895xxxxxxx/My-Demo.git
    git add .
    git commit
    git push -u origin master

  6. 导入代码库
    git clone --bare https://git.example.com/your/project.git your_path
    cd your_path
    git remote set-url origin https://codeup.aliyun.com/61db90e2f9a895xxxxxxx/Demo.git
    git push --mirror

拷贝公钥
windows: clip < ~/.ssh/id_ed25519.pub
Mac: pbcopy < ~/.ssh/id_ed25519.pub
Linux: xclip -sel clip < ~/.ssh/id_ed25519.pub

**

引用自 阿里云帮助中心

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值