项目中遇到的问题

59 阅读1分钟

提交代码到git

在终端 git init; git add .; git commit -m XXX;

克隆git代码到本地

使用git Bash输入 clone git@github.com:XXXXXX/XXXXX.git

创建文件push回github

创建 touch index.css;
git add .;
git commit
git push origin main就可在github预览了

遇到了本地代码推送到远程分支的报错:Permission denied (publickey). fatal: Could not read from remote repository

解决办法:

使用 ssh-keygen 命令重新生成SSH密钥对,然后将 公钥 内容复制并添加到 github.com 的密钥管理处。

ssh-keygen -t rsa -C "YourEmail@qq.com"