错误在git push =! [remote rejected] master - >主人(预接收钩拒绝) [英] Error on git push = ! [remote rejected] master -> master (pre-receive hook declined)

查看:227
本文介绍了错误在git push =! [remote rejected] master - >主人(预接收钩拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为,这是一个与此不同的问题(远程拒绝的主人 - > master(pre-receive hook refused)),并且很多人都面临同样的问题,所以我在这里发布一个新消息。



我的朋友以admin的身份将我加入到bitbucket.org,以便我可以帮助他完成他的项目。所以,我想从我本地的最新代码开始。



我遵循的步骤:


  1. 转到空文件夹

  2. git init

  3. git remote -v (这个没有提供)
  4. git remote add origin< git repo>

  5. git remote add master< git repo的路径>

  6. git remote -v (这个显示包括获取并推入括号内)
  7. git fetch origin master

  8. git pull origin master 文件和文件夹)

  9. touch test (让我们测试一个测试提交)
  10. git status

  11. git add。
    git commit -mtesting,first commit

  12. git push origin master c $ c


    错误:

     计数ob项目:4,完成。 
    使用多达2个线程的增量压缩。
    压缩对象:100%(2/2),完成。
    写入对象:100%(3/3),274字节| 0字节/秒,完成。
    总计3(增量1),重用0(增量0)
    远程:拒绝更新分支主机的权限
    到'<回购路径>'
    ! [remote rejected] master - > master(pre-receive hook refused)
    错误:无法将一些ref转换为'< repo path>'


    <它看起来像在分支管理器中的分支管理(管理设置之一)已经被配置为只允许某些人直接推送给主人。

b
$ b

尝试创建一个分支 - git checkout -b test ,创建您的测试提交并推送 git push origin test :测试。一旦你完成了测试,你总是可以干脆地删除这个分支。



另一个选项(可能最好与谁设置一致)是你去 bitbucket ,然后前往管理员,分支管理并删除 master 以限制。 cf - https://confluence.atlassian.com/display/BITBUCKET/Branch+management


I think, it's a different issue than this(remote rejected master -> master (pre-receive hook declined)), and many people are facing same issue, So I am posting a new here.

My friend added me on bitbucket.org as admin, so that I can help on his project. So, I wanted to start by taking a pull of latest code on my local.

Steps I followed:

  1. Goto empty folder
  2. git init
  3. git remote -v (this gives nothing)
  4. git remote add origin <path to git repo>
  5. git remote add master <path to git repo>
  6. git remote -v (this show both with fetch and push in brackets)
  7. git fetch origin master
  8. git pull origin master (I have latest code now, all files and folders)
  9. touch test (lets test a "test" commit)
  10. git status
  11. git add .
  12. git commit -m "testing, first commit"
  13. git push origin master

error:

Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 274 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: permission denied to update branch master
To '<repo path>'
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '<repo path>'

解决方案

It looks like the branch management (one of the admin settings) in bitbucket has been configured to only allow certain people to push directly to master.

Try creating a branch - git checkout -b test, create your test commit and push git push origin test:test. You can always cleanly delete this branch once you have completed the test.

The other option (probably best agreeing with whoever set this up) is you go to bitbucket and head to admin, branch management and remove master be to limited. cf - https://confluence.atlassian.com/display/BITBUCKET/Branch+management

这篇关于错误在git push =! [remote rejected] master - &gt;主人(预接收钩拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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