如何在没有所有历史记录的情况下将最新的 head/master 从 GIT 推送到 SVN?
我正在处理两个存储库。运行 SVN 和本地 git 存储库的远程服务器。
经过几次编辑后,我已经将我的 head/master 分支带到了我想要的位置。现在我只想通过一次提交将 git 中内容的最新副本推送到一个空的 SVN 目录中,而不需要 100 次提交和所有历史记录来将其到位,并从那时起在未来 git svn dcommit 。
我做了一些搜索,但我发现的所有内容似乎都找到了保留整个 git repo 历史记录的方法,我想只用一次提交进行推送,然后从那里开始 git svn dcommit 未来。
I'm dealing with two repositories. A remote server running SVN and my local git repo.
I've got my head/master branch to where I want it after several edits. Now I just want to push the latest copy of what's in git into an empty SVN directory with a single commit, without the 100 commits and all the history to get it in place and from that point on in the future git svn dcommit.
I did some searching but everything that I turned up seemed to find ways of keeping the entire git repo history, I'd like to push with just a single commit and then git svn dcommit
from there on in the future.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要查看
git rebase -i
http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html这将允许你压缩将历史记录向下分支到一条提交消息。
如果你有两个分支
当你仍在working_branch 中时,你将运行 git rebase -i master 。完成变基后,您可以从这里选择“squash”、“reword”等提交。然后,您将
git checkout master
和git mergeworking_branch
返回到 master。从 master 然后执行 git svn dcommit
You will want to take a look at
git rebase -i
http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.htmlThis will allow you to squash a branch history down to one commit message.
If you have two branches
While still in working_branch you would run
git rebase -i master
. From here you can choose which commits to "squash", "reword", etc. Once you have completed the rebase. You would thengit checkout master
andgit merge working_branch
back into master.From master then do
git svn dcommit