首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"git push“失败:”您没有指定要推送的任何重新规范“

"git push“失败:”您没有指定要推送的任何重新规范“
EN

Stack Overflow用户
提问于 2009-09-25 04:40:57
回答 4查看 10K关注 0票数 2

我在项目储物柜上设置了一个git项目来将我的git文件推送到。然后,我进入目录,在那里我初始化了一个git项目,并安排了我的文件。最后,我尝试用下面的命令将项目推送到project:

代码语言:javascript
复制
$ git push git-smichaels@free5.projectlocker.com:helloworld.git

它会生成以下错误:

代码语言:javascript
复制
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

试图这样做有什么不对吗?

我找到了使用以下语法的人的一个例子

代码语言:javascript
复制
git remote add myproject 'git-myloginname@projectlocker.com:myproj.git'
git push myproject +master:master 

"**remote add**“是否有必要使用?为什么我不能像上面那样直接推到呢?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2009-09-25 04:44:41

这才是真正的错误。您没有读取对存储库的访问权限?

代码语言:javascript
复制
ERROR:gitosis.serve.main:Repository read access denied

剩下的只是警告而已。如果要消除警告,请执行以下操作:

代码语言:javascript
复制
git push git-smichaels@free5.projectlocker.com:helloworld.git [branchname]

如果希望Git在没有警告的情况下指定分支名称时推送当前分支,请执行以下操作:

代码语言:javascript
复制
git config push.default current
票数 15
EN

Stack Overflow用户

发布于 2009-09-25 04:43:15

你真正的问题就隐藏在警告信息里

代码语言:javascript
复制
ERROR:gitosis.serve.main:Repository read access denied

确保您有能力访问存储库。

票数 2
EN

Stack Overflow用户

发布于 2009-09-25 22:39:26

我和ProjectLocker在一起。您可以在ProjectLocker门户中提交一张票证,我们可以查看您的项目,并确保在我们的终端上没有任何问题阻止您访问存储库。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1475468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档