方式
- 使用 token
# 把下面TOKEN替换成你复制的那串令牌
git remote set-url origin https://yinzhidong:TOKEN@github.com/yinzhidong/echo-vite.git
注意: TOKEN、 yinzhidong、echo-vite 修改为你的
- 使用 SSH
ssh-keygen -t ed25519 -C "你的github邮箱"
cat ~/.ssh/id_ed25519.pub
# GitHub 网页:Settings → SSH and GPG keys → New SSH key,粘贴公钥保存
git remote set-url origin git@github.com:yinzhidong/echo-vite.git
注意: yinzhidong、echo-vite 修改为你的