Context
I am writing a script to mirror and periodically refresh some repositories from GitHub. GitHub repos have reference to Pull request branches that have no meaning outside, so I am filtering them out as suggested in Howto: Mirror a GitHub Repo Without Pull Refs. So far the steps are
git clone --mirror SourceGitHubRepoUrlgit remote add --mirror=push alice MyMirrorUrlgit config --local --replace-all remote.origin.fetch "+refs/heads/*:refs/heads/*"git config --local --add remote.origin.fetch "+refs/tags/*:refs/tags/*"
at this point the local mirror has the correct fetch rules and
git remote update origin
works nicely, but
git push --mirror alice
gives errors like ! [remote rejected] refs/pull/22/head -> refs/pull/22/head
because the packed-refs
still lists the refs/pull/*
branches.
Question
How can I fix the content of packed-refs
? Can I simply remove all lines matching "refs/pull"?
This latter seems to work, but one is never sure that there are no lurking gremlins.