Fl0R1D3R
Fl0R1D3R

Reputation: 892

Repository Migration to Gerrit, git push --mirror returns refs/meta/config (cannot delete project configuration)

I got some strange problems when migrating my old git repository which resides in a redmine, to my new Gerrit repository.

Basically i made a

git clone --mirror ssh:// .... old-repo.git
cd old-repo.git/
git push --mirror ssh:// .... new-gerrit-repo

Well, now I first got some warnings:

remote: (W) a01300f: commit message lines >70 characters; manually wrap lines
remote: (W) 8def171: commit subject >65 characters; use shorter first paragraph

which I guess I can ignore, because the original repository will still exist as reference.

My main problem is this error:

! [remote rejected] refs/meta/config (cannot delete project configuration)
error: failed to push some refs to ssh:// .... new-gerrit-repo

After some reading I found out, that this refs/meta/config branch only contains some project specific rules for Gerrit. It's a has a few config files for parametrizing Gerrit. (it's basically the Project Options page under Gerrit "General" Tab) There are no project-related source files.

Can someone help me? Is it save to ignore this error and go on with the migration?

Access push;read;submit rights are given for Administrators on refs/meta/config. Nothing helped.

Thanks for every message!

Upvotes: 9

Views: 4612

Answers (1)

Magnus Bäck
Magnus Bäck

Reputation: 11581

The refs/meta/config ref is indeed only for Gerrit-specific settings (including but not limited to access control settings) for the project. Depending on the source and target it may or may not make sense to migrate it, but you can't do it via --mirror since that's equivalent to deleting and recreating the ref and Gerrit explicitly prohibits deletion of refs/meta/config.

What you could do is mirror all other refs and manually copy the state of the refs/meta/config branch, if it's something in there that's worth keeping.

Upvotes: 4

Related Questions