将新的 Java 项目添加到 Github 位置时出现问题

Issues with adding a new Java project to a Github location

我在将 Java 项目添加到我的 git 区域时遇到了问题。我在步骤中尝试了以下命令:

git init # To my Eclipse Java project folder
git remote set-url origin https://github.com/manmedia/MyProjectFolder.git
git commit -a -m "Initial commit"
git push -u origin master

我在 Whosebug 上查看了类似的问题并尝试应用建议的解决方案,但没有任何效果。我不断收到以下错误消息:

remote: Repository not found
fatal: repository 'https://github.com/manmedia/MyProjectFolder.git' not found.

我是 Git 的新手,正在尝试了解这个野兽(我必须说,与 SVN 和 CVS 相比非常不方便)。我真的需要在 Github.com 上创建存储库然后将其 fork 出来,还是可以直接从我的 Windows 命令提示符执行?

Do I actually need to be on Github.com to create the repository

是的,您需要先在 GitHuhb 上创建一个 empty Git 存储库。

and then fork it out

那时不需要分叉或克隆。您在本地执行的其余命令应该有效。

我只想在 url 中添加您的 GitHub 登录信息:

git remote set-url origin https://<yourLogin>@github.com/manmedia/MyProjectFolder.git

确保你先做了(至少在第一次提交之前)a:

git config --global user.name <yourLogin>
git config --global user.email <yourEmail>