为什么我的git不会推?我创建了存储库,我不断收到此消息:
C:\Users\petey_000\rails_projects\first_app>git push -u github master
Username for 'https://github.com': ***@gmail.com
Password for 'https://***@gmail.com@github.com':
remote: Repository not found.
fatal: repository 'https://github.com/pete/first_app.git/' not found
Run Code Online (Sandbox Code Playgroud)
Von*_*onC 30
您的用户名不应该是电子邮件地址,而应该是您的GitHub用户帐户:pete.
您的密码应该是您的GitHub帐户密码.
您实际上可以直接在远程URL中设置您的用户名,以便Git只请求您的密码:
cd C:\Users\petey_000\rails_projects\first_app
git remote set-url origin https://pete@github.com/pete/first_app
Run Code Online (Sandbox Code Playgroud)
并且你需要fist_app首先在GitHub上创建repo:确保将它创建为完全空的,或者,如果你使用初始提交(包括README.md许可文件和.gitignore文件)创建它,那么在制作它之前先做一个git pull你的git push.
Gau*_*rav 11
如果Windows计算机上出现此问题,请执行以下操作。
三件事:
您的回购名称上有一个尾部斜杠:
$ git remote rm origin
$ git remote add origin https://github.com/pete/first_app.git
Run Code Online (Sandbox Code Playgroud)你需要创建first_app回购.我在GitHub上查看了"pete",但我没有看到存储库.您必须首先创建远程存储库,然后才能推送.
小智 6
就我而言,情况有所不同!但我认为分享我的经验可能会对某人有所帮助!
在 MAC 中,“钥匙串访问”保存了我以前的“Github”密码。我尝试使用新的 GitHub 存储库,但从未成功。当我从我的 MAC 机器的“钥匙串访问”中删除旧的 GitHub 密码时,它起作用了!我希望它能帮助某人。