0

我正在尝试将两个文件从本地机器推送到 gihub 以进行测试,我在 github 上有一个名为 test 的空存储库,在我的机器上有一个本地存储库测试。git push -u origin master但是在我在命令窗口中所做的之后没有得到任何答案:

C:\Users\TJIA\Documents\GitHub\test [master]> git remote add origin https://gith
ub.com/Svampyr/test.git
fatal: remote origin already exists.
C:\Users\TJIA\Documents\GitHub\test [master]> git remote rm origin
C:\Users\TJIA\Documents\GitHub\test [master]> git remote add origin https://gith
ub.com/Svampyr/test.git
C:\Users\TJIA\Documents\GitHub\test [master]> git push -u origin master

我是github的新手,任何人都可以纠正我,谢谢!

4

2 回答 2

1

创建一个新的本地文件夹并尝试这样做:这对您有用吗?您可以将文件添加到这个新文件夹并尝试使用它们;)

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/Svampyr/test.git
git push -u origin master

也许您的存储库中没有提交?如果您不知道,请输入“git log”并检查是否有。

于 2012-08-09T07:06:39.217 回答
0

要查看发生了什么,请尝试运行:

GIT_TRACE=2 git push -u origin master

您是否也尝试过推送到 SSH 网址而不是 https 网址?

于 2012-08-09T07:44:57.890 回答