将 git-svn 更改提交到 SVN 存储库
我们公司有一个中央 SVN 存储库。当我未连接到公司网络时,我在笔记本电脑上使用 git-svn 以便能够使用存储库。 现在我出差了 3 周,并为我本地的 Git 存储库投入了很多精力。 SVN 存储库也有许多提交。 当我尝试“SVN Rebase”时,我必须编辑每个 Git 变更集中的冲突。我想做的只是一次提交所有本地更改,然后仅编辑一次冲突。
我对 Git 相当陌生,所以我不知道这是如何正确完成的以及这是否是最好的方法。 我在 Windows 上使用 TortoiseGit,所以到目前为止我并不真正关心命令行。
感谢您的帮助。
we have a central SVN repo in our company. I use git-svn on my laptop to be able to use a repo, when I'm not connected to the company network.
Now I was 3 weeks on a business trip and committed a lot to my local Git repo. There were also many commits to the SVN repo.
When I try "SVN Rebase" I have to edit conflicts in each of my Git changesets. What I would like to do is just to commit all of my local changes at once and then edit conflicts only once.
I'm fairly new to Git, so I don't know how this is done properly and if this is the best way.
I use TortoiseGit on Windows, so up to now I didn't really care about the command line.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一旦您在 git-svn rebase 中完成冲突解决,一旦您处于包含您的解决方案的新提交的新树中。未来的 git-svn rebase 不会遇到同样的问题(与重复合并不同,这正是 rerere 派上用场的地方)。
如果“一次提交所有本地更改”意味着您希望将所有提交折叠到 git(以及后来的 SVN)中的单个提交中,那么您可以使用 git rebase -i 来“压缩” “您的所有提交都集中到一个提交中。您不应在该
rebase -i
中包含已使用dcommit
发送到 SVN 的任何修订,因为您正在重写历史记录。当您git-svn rebase
时,您仍然需要解决冲突,就像您仅使用SVN并执行svn update
一样。Once you go through conflict resolution in
git-svn rebase
once you are in a new tree with new commits that include your resolutions. A futuregit-svn rebase
will not encounter the same problems (unlike repeated merges, which is wherererere
comes in handy).If by "commit all my local changes at once" you mean you want to fold all of your commits into a single commit in git (and later SVN) then you can use
git rebase -i
to "squash" all of your commits into a single commit. You should not include any revisions that have already been sent to SVN withdcommit
in thatrebase -i
because you are rewriting history. You will still have to resolve conflicts when yougit-svn rebase
just like you would if you were using only SVN and didsvn update
.