“git push”失败:“您没有指定任何refspecs推送” [英] "git push" failed: "You did not specify any refspecs to push"

查看:1203
本文介绍了“git push”失败:“您没有指定任何refspecs推送”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在projectlocker上建立了一个git项目来推送我的git文件。然后我进入了我已经初始化一个git项目的目录,并且执行了我的文件。最后我试着用这个命令将项目推送到projectlocker:

  $ git push git-smichaels@free5.projectlocker.com :helloworld.git 

它会产生这个错误:

 警告:您没有指定任何推送参数,并且当前的远程
警告:尚未配置任何推送参数。此
warning:case中的默认操作是推送所有匹配的refspecs,即所有分支
warning:本地和远程存在的都将被更新。这可能是
警告:不一定是你想要发生的事情。
警告:
警告:您可以指定在这种情况下要执行的操作,以及
警告:通过将push.default配置为:$ b $,避免再次看到此消息b警告:'没有':不要推送任何东西
警告:'匹配':推送所有匹配的分支(默认)
警告:'跟踪':将当前分支推送到任何正在跟踪的
警告:'当前':推送当前分支
错误:gitosis.serve.main:存储库读取访问被拒绝
致命:远程端意外挂起


试图按这种方式出现问题吗?



我发现使用这种语法的人的例子

  git remote添加myproject'git-myloginname@projectlocker.com:myproj.git'
git push myproject + master:master

它是n必须使用远程添加 - 为什么我不能像上面那样直接推送到URL?

解决方案

这是真正的错误。您没有对版本库的读取权限?

 错误:gitosis.serve.main:版本库读取访问被拒绝

剩下的只是警告。如果您想摆脱警告,请执行以下操作:

  git push git-smichaels@free5.projectlocker.com:helloworld .git [branchname] 

如果您希望Git在未指定[branchname]时推送当前分支没有警告,做到这一点:

  git config push.default current 


I set up a git project on projectlocker to push my git files to. Then I went into the directory where I had initialized a git project and staged my files. And finally I tried to push the project to projectlocker with this command:

$ git push git-smichaels@free5.projectlocker.com:helloworld.git

It generates this error:

warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated.  This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning:   'nothing'  : Do not push anything
warning:   'matching' : Push all matching branches (default)
warning:   'tracking' : Push the current branch to whatever it is tracking
warning:   'current'  : Push the current branch
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly

Is there something wrong with trying to push this way?

I found an example of someone using this syntax:

git remote add myproject 'git-myloginname@projectlocker.com:myproj.git'
git push myproject +master:master 

Is it necessary to use "remote add" - why can I not push directly to the URL as I did above?

解决方案

This is the real error. You don't have read access to the repository?

ERROR:gitosis.serve.main:Repository read access denied

The rest are just warnings. If you want to get rid of the warnings, do this:

git push git-smichaels@free5.projectlocker.com:helloworld.git [branchname]

If you want Git to push the current branch when [branchname] is not specified without warning, do this:

git config push.default current

这篇关于“git push”失败:“您没有指定任何refspecs推送”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆