Quantcast
Channel: User Giulio Vian - Stack Overflow
Viewing all articles
Browse latest Browse all 38

How to rebuild the packed-refs file

$
0
0

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.


Viewing all articles
Browse latest Browse all 38

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>