我已经阅读了无数的教程,但我总是做不到。以下是我得到的:

我在Windows桌面上运行RubyMine 我已经按照他们的指示在我的WebFaction托管帐户上安装了Git Git似乎在两台机器上都能正常工作

这是我正在做的:

在服务器: mkdir项目 git init Git添加。 Git提交#==>什么都没有提交 客户端: 在RubyMine中创建新项目 Git初始化在项目的顶部目录 Push changes to server #==> failed to Push some ref to…

我遗漏了哪些步骤?


当前回答

运行以下命令

git config --local -e

变更分录

url = git@github.com:username/repo.git

to

url = https://github.com/username/repo.git

其他回答

在提交之前,您必须至少向存储库添加一个文件,例如.gitignore。

如果您的项目没有上游分支,也就是说,如果这是远程存储库第一次知道在本地存储库中创建的分支,那么下面的命令应该会起作用。

git push --set-upstream origin <branch-name>

您需要在客户端上设置远程存储库:

git remote add origin ssh://myserver.com/path/to/project

运行以下命令

git config --local -e

变更分录

url = git@github.com:username/repo.git

to

url = https://github.com/username/repo.git

@Josh Lindsey已经回答得很好了。但我想添加一些信息,因为我经常使用ssh。

因此只需改变:

git remote add origin youruser@yourserver.com:/path/to/my_project.git

to:

git remote add origin ssh://youruser@yourserver.com/path/to/my_project

注意,域和路径之间的冒号已经不存在了。