git svn 在初始化后忽略主干

发布于 2024-12-19 11:18:37 字数 257 浏览 3 评论 0原文

我们有一个中央 svn 存储库,并开始让人们在本地使用 git 来管理工作项。

当我第一次设置本地 git 存储库时,我设置了ignore-path来忽略主干,这样我就可以只在一个分支上工作。我的同事并没有忽视行李箱。直到我们开始使用第三个裸存储库来相互推送/拉取分支之前,这一切都很好。

当我拉他们的 git 分支时,它把主干当作一个添加,现在一团糟。

当我运行 git svn 时,我现在确实希望它同步主干。如何从本地存储库重新添加/取消忽略主干?

We have a central svn repository and are starting to have people use git locally to manage work items.

When I first set up my local git repository, I set ignore-path to ignore trunk so I could just work on one branch. My coworker did not ignore trunk. This was fine until we started to use a third bare repository to push/pull branches to each other.

When I pull their git branch, it treated trunk as an add and now its a mess.

When I run git svn I now do want it to sync the trunk. How do I re-add/unignore trunk from my local repository?

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

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

发布评论

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

评论(1

猫九 2024-12-26 11:18:37

当您使用 git-svn 访问 svn 存储库时,最好的方法是仅使用 subversion 存储库来共享代码。

当我运行 git svn 时,我现在确实希望它同步主干。如何从本地存储库重新添加/取消忽略主干?

当您运行 git svn fetch 时,应该导入分支的新 svn 修订版。

当我拉他们的 git 分支时,它把主干当作一个添加,现在一团糟。

现在您已经共享了 git 修订版,您必须使用 git rebase --interactive 和 gitcherry-pick 来线性化历史记录,并使用 git rebase --interactive 将其推送到 subversion >git svn dcommit。


1 托马斯·费里斯·尼古拉森 克里斯·布朗详细描述了当你想与共享 svn 镜像交换代码时你必须做什么。

When you use git-svn to access an svn repository, the best way is to only use the subversion repo to share code¹.

When I run git svn I now do want it to sync the trunk. How do I re-add/unignore trunk from my local repository?

When you run git svn fetch, the new svn revisions of your branch should be imported.

When I pull their git branch, it treated trunk as an add and now its a mess.

Now that you already have shared git revisions, you have to use git rebase --interactive and git cherry-pick to linearize the history, and push it into subversion with git svn dcommit.


¹ Thomas Ferris Nicolaisen and Kris Brown described in detail what you have to do when you want to exchange code with an shared svn mirror.

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