将新项目推送到github时出错:https://https:.



我正在尝试向我的github帐户添加一个新项目。以下是我遵循的步骤:

git init
touch readme.txt
git add .
git commit -m "added new project"
git remote add origin https://github.com/beahowel117/farm.git
git push -u origin master

但我一直在追求git-init:

Reinitialized existing Git repository in /Users/bethhowell/Projects/farm/.git/

即使我去我的github,这个项目也不在

我继续执行命令,然后我得到:

fatal: unable to access 'https://https://github.com/beahowel117/farm.git/': Could not resolve host: https

我甚至尝试过重新开始并创建一个全新的项目,但同样的错误不断出现。

有人看到这个吗?我在网上找不到任何帮助。

谢谢!

但我一直在追求git-init:

Reinitialized existing Git repository in /Users/bethhowell/Projects/farm/.git/

这是意料之中的事。如果你已经在某个文件夹中说了git init,那么如果你再次说,你会正确地看到该消息,因为它正确地告诉你,你以前已经这样做过。

即使我去了我的github,项目也不在

这是意料之中的事。在本地说git init对远程GitHub没有任何影响。然而,在GitHub,repo在那里(我知道,因为我能看到它(;它只是空的,因为你还没有推动它。

我继续执行命令,然后我得到:

fatal: unable to access 'https://https://github.com/beahowel117/farm.git/': Could not resolve host: https

这表明您输入的git remote add命令不正确。但你没有向我们展示你真正在说什么,所以不可能更具体地说明你做错了什么。您向我们展示的只是:

git remote add origin https://github.com/user/projectname.git

这显然是伪造的。

在正确地发出git remote add命令之前,您将无法执行git push,在git push之前,您的存储库提交将不会复制到GitHub。所以你会被卡住,直到你得到正确的命令。

相关内容

最新更新