本文介绍了错误在git push =! [remote rejected] master - >主人(预接收钩拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我认为,这是一个与此不同的问题(),并且很多人都面临同样的问题,所以我在这里发布一个新消息。
我的朋友以admin的身份将我加入到bitbucket.org,以便我可以帮助他完成他的项目。所以,我想从我本地的最新代码开始。
我遵循的步骤:
- 转到空文件夹
-
git init
-
git remote -v
(这个没有提供)
-
git remote add origin< git repo>
-
git remote add master< git repo的路径>
-
git remote -v
(这个显示包括获取并推入括号内)
-
git fetch origin master
-
git pull origin master
文件和文件夹)
-
touch test
(让我们测试一个测试提交)
-
git status
-
git add。
git commit -mtesting,first commit
-
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 -
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:
- Goto empty folder
git init
git remote -v
(this gives nothing)git remote add origin <path to git repo>
git remote add master <path to git repo>
git remote -v
(this show both with fetch and push in brackets)git fetch origin master
git pull origin master
(I have latest code now, all files and folders)touch test
(lets test a "test" commit)git status
git add .
git commit -m "testing, first commit"
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 - >主人(预接收钩拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!