git config --global user.name "username"
git config --global user.email "11323987+username@user.noreply.gitee.com"
mkdir project
cd project
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/username/project.git
git push -u origin "master"
如果已有远程仓库:
git remote -v
git remote remove origin
git init
git remote add origin https://gitee.com/username/project.git
就连接上新的远程仓库啦
远程为:
https://gitee.com/username/project.git
生成公钥
ssh-keygen -t ed25519 -C "tanhaoyun@gitee.com"
cat ~/.ssh/id_ed25519.pub
将公钥添加到远程
最后在终端输入
ssh -T git@gitee.com
若返回Hi Anonymous! You’ve successfully authenticated, but GITEE.COM does not provide shell access.则代表生成成功。