无法使用令牌部署 create-react-app

Can not deploy create-react-app with token

我一直在尝试部署 create-react-app,但出现错误

fatal: repository 'https://github.com/charyyev2000/Portfolio-React.git/' not found

然后我创建了一个 令牌 并尝试使用它进行部署,

git remote add origin https://<TOKEN>@github.com/charyyev2000/Portfolio-React.git

又报错了;

已删除存储库,重新创建并尝试部署,再次出现同样的错误

fatal: repository 'https://github.com/charyyev2000/Portfolio-React.git/' not found

我做错了什么?或者,我在 packages.json 中的主页有问题吗?

"homepage": "https://charyyev2000.github.io/Portfolio-React",

我也无法从我的任何其他存储库进行部署。 我现在该怎么办

您的存储库可能是私有的。

试试这个:git remote set-url origin https://YOUR_GITHUB_USER@github.com/charyyev2000/Portfolio-React.git

或者使用 ssh 密钥。

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent&ved=2ahUKEwjoysreiIjzAhVwTTABHQPHDzIQFnoECGwQAQ&sqi=2&usg=AOvVaw2B_nuIizqk0LtbV4qWtzzH

你是Git/GitHub工具的新手,希望你能完成这个任务。

您的远程存储库 URL 是 https://github.com/charyyev2000/Portfolio-React

解决方案 1: 在命令行上创建一个新的存储库

echo "# Portfolio-React" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/charyyev2000/Portfolio-React.git
git push -u origin main

解决方案2:(我想你会更喜欢这个解决方案,因为你的源代码是存在的)。

从命令行推送现有存储库

git remote add origin https://github.com/charyyev2000/Portfolio-React.git
git branch -M main
git push -u origin main

跟着攻略看你喜欢什么

P/S:有时候,你需要

git add .
git commit -m"foo"
git push -v

或者您在控制台屏幕上看到任何指南,让我们按照您看到的指南进行操作。