Git remote is not being deleted by git-filter-repo when cloned with --mirror
Thanks for this awesome tool. I found a "small" issue which may be severe.
Edit: new description since I found out what specifically triggers the issue. Old text below.
When the git repo is cloned with --mirror, git filter-repo does not delete the remote origin address. When the git repo is cloned without --mirror, git filter-repo deletes the remote.
--- old text follows --- The user manual states:
git-filter-repo deletes the "origin" remote to help avoid people accidentally repushing to the same repository, so you’ll need to remind git what origin’s url was. You’ll have to look up the command for that.
However, it doesn't. I've tried the tool, and the remote is still active. Is the user manual wrong, so that it needs another command line flag to do it, or is the functionality broken?
Can you report the output of git remote -v after running, and the git-filter-repo command line you used?
Can you report the output of
git remote -vafter running, and the git-filter-repo command line you used?
PS > git remote -v
origin <repourl> (fetch)
origin <repourl> (push)
I'm experimenting with a quite large repo rewrite which uses different filter-repo commands.
git filter-repo --tag-rename
git filter-repo --replace-message
git filter-repo --invert-paths
git filter-repo --path-rename
git filter-repo --replace-refs
git filter-repo --mailmap
Are you using --partial, --refs, --source, or --target by chance?
No, I'm not using --partial, I'm not afraid of a complete rewrite (it will be anyway), and I'm also replacing in-situ, not using --source or --target. Also I'm always going through the whole repo, so no --ref.
If that matters: the original repo is cloned using --reference and then issuing git repack -a -d and removing the alternate file before the use of git filter-repo. But I think this should not matter.
It's a --mirror clone, if this matters?
If you need any more information, I'll be happy to provide. Unfortunately it's a private repo I can't share.
I did some testing, and the culprit is --mirror when cloning. When I clone "normally", gilter filter-repo removes the remote. I'll update the title and the text accordingly.
Ah, yeah, good catch. It bases on whether there are refs/remotes/origin/* refs to rewrite, which there won't be for a mirror clone. Updating the docs would be good.