admin管理员组文章数量:1240593
we have a huge monolithic repository in the form of
master-repo
|-- libraries
|-- db-backend
| |-- plsql
| |-- data
| `-- scripts
|-- server-backend
|-- ...
`-- frontent
including multiple branches and versions accumulated over time and may look like this:
commit tag message
cf068d3d ver-2.0 release build
315a01c6 fix issue in frontend
401b6520 add feature to server-backend
eed705bd fix issue in db-backend
f9c0c94e ver-1.9 release build
7c5c56d2 add feature to db-backend
63affce3 add feature to db-backend
21385a5c add feature to server-backend
c9fc18ea fix issue in frontend
2a732d25 ver-1.8 release build
788e59a6 merge from branch toto
77c88fed fix issue in db-backend
...
fbd4703f ver-0.1 release build
The goal is to split this into several smaller repos like:
db-backend
|-- plsql
|-- data
`-- scripts
I was first trying to use something like
git filter-branch --index-filter 'git ls-files \
| grep -v "^db-backend/" \
| xargs --no-run-if-empty git rm --cached' HEAD
But I was running in a couple of issues including problems with large files or that some files didn't got cleaned up etc.
So instead I then used git subtree split --prefix db-backend/ --branch split_db_backend
which works a lot better, however I am loosing all the tags which are indeed associated to commit on the root of the repository.
The subtree command doesn't seem to have any additional options related to tags, so I assume I have to create a small batch to loop over all commits in the original repo branch and search for commits containing in the resulting branch and then manual re-tag them.
But I struggle with creating a command to find the latest tag which includes my commit in the split, and doing this only on the latest commit in the history (to avoid tagging all commits in the history).
For example, if I would loop over the resulting commits in the generated subtree split using for tag in 'git tag -l --contains eed705bd\' do
I would get all commits and tags down to tag ver-0.1, but this change was actually only included in tag ver-2.0
Any help would be appreciated.
本文标签: git tagHow to take over tags from git master branch into subtree splitStack Overflow
版权声明:本文标题:git tag - How to take over tags from git master branch into subtree split - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740024036a2220915.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论