作者:手机用户2502854043 | 来源:互联网 | 2022-11-20 11:35
I've a repository for my dotfiles and went to push changes from a branch only to encounter...
$ git push
Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Writing objects: 100% (46/46), 3.20 MiB | 1.52 MiB/s, done.
Total 46 (delta 0), reused 0 (delta 0)
To gitlab.com:auser/dotfiles.git
! [remote rejected] kimura -> origin/kimura (deny updating a hidden ref)
! [remote rejected] master -> origin/master (deny updating a hidden ref)
error: failed to push some refs to 'git@gitlab.com:auser/dotfiles.git'
This thread suggests its because pull requests made on origin and links to a blog post with solution of how to skip this, although I do not explicitly have refs/pull
in the path thats being rejected so it may be a different issue but I couldn't find much info on this so figured I try the proposed solution and updated my config to...
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@gitlab.com:auser/dotfiles.git
fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
fetch = +refs/change/*:refs/change/*
pushurl = git@gitlab.com:auser/dotfiles.git
push = +refs/heads/*:refs/remotes/origin/*
[submodule "oh-my-zsh/.oh-my-zsh"]
url = https://github.com/robbyrussell/oh-my-zsh
active = true
[branch "master"]
remote = origin
merge = refs/heads/master
pushRemote = origin
[branch "kimura"]
remote = origin
merge = refs/heads/kimura
fetch = +refs/heads/*:refs/heads/*
fetch = +refs/tags/*:refs/tags/*
fetch = +refs/change/*:refs/change/*
But the problem persists. My branches are...
$ git branch -a
* kimura
master
remotes/origin/kimura
remotes/origin/master
The host I'm trying to push from is where I started the repo before mirroring to Gitlab.