我在虚拟机上设置了一个 git 存储库,它运行良好。我在本地计算机上克隆了存储库,并使用一个简单的文件对其进行了测试,一切都有效。
我现在想做的是将开发目录中的一些文件提交到我的 git 存储库,但是当我这样做时,我有以下错误消息:
error: src refspec master does not match any.
error: can't push references to 'git@github.com:ezsystems/ezplatform.git'
奇怪的是我的存储库不是"git@github.com:ezsystems/ezplatform.git",我通常使用 SSH 连接将我的文件推送到我的虚拟 git 服务器!另外,因为我正在从事 Web 项目,所以我将我的开发目录的符号链接直接链接到我的本地 git 存储库中。我不认为这是一个问题。当我想推送开发目录中的文件时,我也有这条消息:
git commit -m "adding files"
Actually on no branch
Modifications that will not be validated :
[bunch of file names]
No modification add to the validation
你有什么线索可以帮助我解决这个问题吗?
git remote add origin ssh://[user]@[server_address]/[git_repo_url]
这将创建一个名为 origin 的 git 远程。每个部分细分如下:-
[用户] 应替换为服务器上对 git 存储库具有读写访问权限的用户。
[server_address] 是托管 git 存储库的服务器的 FQDN
。[git_repo_url] 是 git 存储库在服务器上的位置。
要推送您的存储库,请键入以下命令:-
git push -u origin master