• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Elaine00
博客园    首页    新随笔    联系   管理    订阅  订阅

git push报错

下午在做git的一些相关操作的时候,遇到了个问题,现在记录下来:

情景:我在E盘建立了一个仓库和一个工作空间,先把仓库里面的项目clone到工作目录,然后修改工作目录里面的东西,修改了之后打算push回去仓库里面,结果,问题大了,push出现错误了:

错误信息如下:

remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To E:/git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'E:/git'

我搜索了网上相关解决方案,找到了解决方法,根据步骤。我在工作空间里面执行了以下命令:

git config receive.denyCurrentBranch ignore(这个命令用于初次配置git的接收)
接着我再度尝试,结果,出现了下面另一个错误:

remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To E:/git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'E:/git'
Done

经过再度思考,考虑到刚刚只是配置工作空间的git接受,但是真正的仓库还没有配置,那么就没法进行对接了,所以,我在仓库执行了相同命令,问题解决了~~

==================================================================
欢迎交流:QQ392989505
作者:王瓒
作者:Elaine
出处:http://www.cnblogs.com/ITGirl00/
交流QQ:392989505
posted @ 2013-12-02 00:49  Elaine00  阅读(739)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3