自学内容网 自学内容网

GitLab: You cannot create a branch with a SHA-1 or SHA-256 branch name

最近在迁移git库,把代码从gerrit迁移到gitlab,有几个库报错如下:

GitLab: You cannot create a branch with a SHA-1 or SHA-256 branch name

 ! [remote rejected] refs/users/73/373/edit-95276/1 -> refs/users/73/373/edit-95276/1 (pre-receive hook declined)

warning: refname '3cea05a895248375c125b632d0d78f2d9bc5023d' is ambiguous.
Git normally never creates a ref that ends with 40 hex characters
because it will be ignored when you just specify 40-hex. These refs
may be created by mistake. For example,
git checkout -b $br $(git rev-parse ...)
where "$br" is somehow empty and a 40-hex ref is created. Please
examine these refs and maybe delete them. Turn this message off by
running "git config advice.objectNameWarning false"
Counting objects: 100159, done.
Delta compression using up to 40 threads.
Compressing objects: 100% (39493/39493), done.
Writing objects: 100% (100159/100159), 365.46 MiB | 62.86 MiB/s, done.
Total 100159 (delta 42190), reused 100159 (delta 42190)
remote: Resolving deltas: 100% (42190/42190), done.
remote: GitLab: You cannot create a branch with a SHA-1 or SHA-256 branch name.
To ssh://192.168.4.4:8082/webwebweb
 ! [remote rejected] refs/cache-automerge/5a/f6eb693cae5b1f837aee8bdb7a24d23bc9439b -> refs/cache-automerge/5a/f6eb693cae5b1f837aee8bdb7a24d23bc9439b (pre-receive hook declined)
 ! [remote rejected] refs/users/73/373/edit-95276/1 -> refs/users/73/373/edit-95276/1 (pre-receive hook declined)
error: failed to push some refs to 'ssh://192.168.4.4:8082/webwebweb'

解决方法:

分支或者tag里面有那种超过40个字符的,导致迁移失败。把对应的分支或者tag删除再重新提交即可。


原文地址:https://blog.csdn.net/yelu_hong/article/details/144134171

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!