Reputation: 131
I have a couple of large long-lived repos that I'm merging together into one repo, with each current repo as subdirectories of the new repo:
oldrepo1
oldrepo2
becomes
newrepo/oldrepo1
newrepo/oldrepo2
I'm using git filter-repo to do several things, like removing some stale deleted folders, getting rid of large files, moving the root folder down (needed for merging into the new repo), moving tags into a subfolder (i.e. tag1 -> oldrepo1/tag1), and modifying commit messages for various informational things related to migration
I'm going through an intermediate repo for doing history rewrites because I can't alter the original one without much pain, so I've got a migration workflow like this: oldrepo1 -> oldrepo1_tmp -> newrepo, where oldrepo1_tmp is where I've done the initial cleanup and history alteration.
I've done the initial migration, but there will be some time (several weeks) between this initial migration and when all of my devs will move into the new location where I need to do some regular forward migration to keep the new repo up to date during this transition.
For the forward migration effort, in my oldrepo1 clone (original repo local clone), then running:
git filter-repo <***> --target oldrepo1_tmp --refs <last_commitid_migrated>..HEAD
where <***> is a set of options for all of the same modifications I've done for the original migration.
In other words, I'm just modifying the history of all commits since I last migrated.
This is working fine for the commits, but it's not bringing tags that were created during that commit range over
I found this thread: Git filter-branch to filter-repo : tags not rewritten
which suggested using --refs $branch $(git tag -l)
but that wants to add all tags (of which there are hundreds).
Is there a way I can get the tags that were created only within the given ref range? That is, any tag created between <commitid1>..<commitid2> (I'm specifically only working in one branch [master])
Alternatively, is there some way to tell git-filter-rep to also include tags in that range when using the --refs arg?
Upvotes: 3
Views: 1214
Reputation: 52006
git log
has the --decorate=full
and --decorate-refs=pattern
options.
You can also use git show-ref
and grep through its output :
git show-ref | grep -f <(git rev-list <commit range>)
Upvotes: 0