如何将 git-svn 与 Github 一起使用,并避免冲突?
我正在使用 Git 作为 WP 插件的 SCM。但当然,我必须将其提交到 svn 存储库,以便它显示在 WordPress 插件目录中。我已经写了指南如何执行此操作,以便您可以看到我正在使用的步骤。
每当我要提交到 svn 时,我都会在 git svn dcommit 之前执行 git rebase trunk 来更新 svn trunk。但是,如果我从 GitHub 拉取然后执行变基,我会在其他人完成的所有提交上遇到冲突错误。
这是什么原因,我能在这里做什么?
因为冲突总是发生在另一位作者的所有提交上,这让我想到应该在 git rebase trunk 之前运行另一个命令(例如 rebase)来正确合并这些文件或者什么的。
I am using Git for my SCM of a WP Plugin. But of course I then have to commit it to an svn repo for it to be displayed in the WordPress Plugin Directory. I have written a guide on how to do this so you can see the steps I am using for it.
Whenever I am about to commit to the svn, I do a git rebase trunk
to update the svn trunk before the git svn dcommit
. However, if I pull from GitHub and then do the rebase I get conflict errors on all of the commits that have been done by someone else.
What is the reason, and what can I do here?
Because the conflicts are always on all of the commits by another author this gives me the idea that there should be another command (something like rebase) that I should run before git rebase trunk
that will merge these files properly or something.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定,但我认为您不想从 Github 中提取,而是想从 Github 获取。
git pull
相当于git fetch
然后是git merge
,并且 git-svn 不能很好地与 git merges 配合使用。I'm not sure, but I think that instead of
pull
ing from Github, you want tofetch
from Github. Agit pull
is equivalent to agit fetch
then agit merge
, and git-svn doesn't play well with git merges.