Git - 重写历史并将文件夹视为分支

发布于 2024-10-14 09:32:44 字数 492 浏览 1 评论 0原文

我有一个 Git 存储库,代表从 git-tfs 拉入的源存储库。

TFS 具有将分支作为完整副本存储在文件夹中的约定。我想遍历 TFS 的 git 副本的历史记录,将针对特定文件夹的提交视为针对特定分支的提交。

例如,存储库看起来像

Main (TFS concept of trunk / master / default)
Branch1
Branch2
Branch3
Folder/Branch4

为了让事情变得更复杂一些,其中一些分支在某个时间点被重命名。

因此 Branch1 可能曾经是 B1。

我也必须适应这种情况。

当然,还存在从一个分支到另一个分支的合并。

我不确定这是否可以做到,但我有兴趣看看是否有人有任何建议。我看过 git-filter-branch,但我不确定最终结果是否正是我想要的。因此,虽然我可以继续实验,直到得到某种正确的东西,但我想我会问是否有人以前做过这个;0

I have a Git repository representing a source repository pulled in from git-tfs.

TFS has the convention of storing branches as full copies in folders. I'd like to run through the history of the git copy from TFS, treating commits against specific folders instead as commits against specific branches.

For instance, the repository looks something like

Main (TFS concept of trunk / master / default)
Branch1
Branch2
Branch3
Folder/Branch4

To make this a little more complicated, some of these branches were renamed at some point in time.

So Branch1 could have at one point been B1.

I'll have to accommodate this scenario as well.

And of course, there were merges from one branch to another.

I'm not sure if this can even be done, but I'm interested to see if anyone has any suggestions. I've looked at git-filter-branch, but I'm not sure the end result would be what I'm looking for exactly. So while I could keep experimenting until I get something kinda-sorta right, I figured I'd ask if anyone has done this before ;0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

離人涙 2024-10-21 09:32:44

我以前没有这样做过,但这样的转换可能涉及:

I haven't done it before, but such a transformation might involve:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文