git push提交代码出现“One or more refs/for/ names blocks change upload”问题的解决办法
来源:互联网 发布:linux虚拟机加载u盘 编辑:程序博客网 时间:2024/05/29 02:30
错误:fatal: One or more refs/for/ names blocks change upload
fatal: Could not read from remote repository.
对于我这个开发狗临时兼任一下SCM角色的人来说,必须先度娘/google了。网上的方法有:
To solve this problem all real branches that exist under the refs/for/ namespace have to be deleted or renamed in the remote git repository.
To see which branches exist under the refs/for/ namespace a Gerrit administrator can run the following command:$ git for-each-ref refs/for
If all these branches should be deleted it can be done with the following command:
$ for n in $(git for-each-ref --format='%(refname)' refs/for); do git update-ref -d $n; done
Branches under the refs/for/ namespace can be created by users that bypass Gerrit and push directly to the git repository itself (not using the Gerrit server’s SSH port).
但是本地使用git for-each-ref refs/for并没有返回任何东西;因此这个解决办法对我遇到的问题没有用。
度娘搜索不到什么有用的信息,只能FQ用google了,发现有一篇文章和我的问题很像:http://repo-discuss.narkive.com/UDj3xce9/refs-for-names-blocks-but-no-actual-refs-for-branch-there
然后根据文中所讨论提到的命令:git ls-remote aosp refs/for/*
返回结果为:
$ git ls-remote aosp refs/for/*
7de2464cf0c651c51bbc6cdc7ac4c531bd4c9f0a refs/for/imdata_l_r8
$ git show 7de2464cf0c651c51bbc6cdc7ac4c531bd4c9f0a
fatal: bad object 7de2464cf0c651c51bbc6cdc7ac4c531bd4c9f0a
应该是由于这个object有问题导致的,但该文章最后只是说要删掉这个ref,但是没有说具体怎么操作。然后又是各种搜索,无功而返。最后实在没有办法,跑到服务器的代码库中,对比了一下./platform/frameworks/base.git/refs/ 和 ./platform/frameworks/av.git/refs/,发现base.git里面比av.git多一个for文件夹,并且该文件夹里面有一个imdata_l_r8的文件,里面就存着7de2464cf0c651c51bbc6cdc7ac4c531bd4c9f0a字符串,应该代表了7de2464cf0c651c51bbc6cdc7ac4c531bd4c9f0a object。一狠心把for文件夹全部删除,OK,再在本地使用git ls-remote aosp refs/for/* 已经查不到任何东西了。然后使用git命令提交,搞定,gerrit起作用了。
真不容易,搞了一天,mark一下!
- git push提交代码出现“One or more refs/for/ names blocks change upload”问题的解决办法
- fatal One or more refs for names blocks change upload
- One or more refs/for/ names blocks change upload
- github 提交代码 failed to push some refs to git
- 解决git本地仓库与远程仓库关联出现 failed to push some refs to git的问题
- git push . :refs/for/foo 意思
- 提交git push 时failed to push some refs to
- git上传代码 出现 failed to push some refs to 解决方案
- git中 Please merge (or rebase) the change locally and upload the resolution for review.
- git提交错误failed to push some refs to ...
- git push 和repo upload-----"no branches ready for upload"
- Validation failed for one or more entities
- Validation failed for one or more entities
- arcgis的One or more layers failed to draw: 问题
- git push 遇到missing change id的问题
- 2017-05-10 idea的git提交push出现missing changeid的问题
- VS2013出现“cannot find one or more components .Please reinstall the application”解决办法
- git 首次使用以及error: failed to push some refs to ****问题的解决
- Prestashop如何进行路由
- LeetCode题解——Reverse Linked List II
- QT5.3连接mysql数据库
- codeforces 294B B. Shaass and Bookshelf(dp)
- Windows7下安装MongoDB
- git push提交代码出现“One or more refs/for/ names blocks change upload”问题的解决办法
- 给windows 7安装文件添加USB3.0驱动
- RSA算法原理(一)
- Node.js开发框架Express4.x
- 类的成员变量作为pthread_create的参数
- RSA算法原理(二)
- 求一个字符串的最长重复子串
- nginx-ssl模块
- TeamCity使用过程中遇到的问题记录