简体   繁体   English

将错误推送到远程git存储库

[英]Push error to a remote git repository

I set up a git repository on a VM which is working pretty fine. 我在运行良好的VM上建立了一个git存储库。 I cloned the repository on my local computer and tested it with a simple file, all worked. 我在本地计算机上克隆了存储库,并用一个简单的文件对其进行了测试,一切正常。

What I want to do now is to commit some files from my development directory to my git repository, but when I do I have the following error message : 我现在要做的是将开发目录中的某些文件提交到git存储库,但是当我这样做时,出现以下错误消息:

error: src refspec master does not match any.
error: can't push references to 'git@github.com:ezsystems/ezplatform.git'

Strange thing is that my repo is not "git@github.com:ezsystems/ezplatform.git", I normally push my files with an SSH connection to my virtual git server ! 奇怪的是,我的存储库不是“ git@github.com:ezsystems / ezplatform.git”,我通常使用SSH连接将文件推送到虚拟git服务器! Also, because I am working on web project, I did a symbolic link of my development directory directly into my local git repo. 另外,因为我正在从事Web项目,所以我将开发目录的符号链接直接链接到本地​​git repo中。 I don't think it is a problem. 我不认为这是一个问题。 I also have this message when I want to push a file who is in my development directory : 当我要推送开发目录中的文件时,我也会收到此消息:

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

Do you have any clues to help me solve this problem ? 您有什么线索可以帮助我解决这个问题吗?

git remote add origin ssh://[user]@[server_address]/[git_repo_url]

This will create a git remote named origin . 这将创建一个名为origin的git remote。 Each part is broken down below:- 每个部分细分如下:

The [user] should be replaced by a user on the server that has read and write access to the git repo. [user]应该由对git repo具有读写访问权限的服务器上的用户替换。

The [server_address] is the FQDN of the server hosting your git repo. [server_address]是托管您的git repo的服务器的FQDN。

The [git_repo_url] is the location of the git repo on the server. [git_repo_url]是git repo在服务器上的位置。

For pushing your repo type this command:- 要推送您的仓库,请输入以下命令:

git push -u origin master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM