开发者

How do you push the latest head/master into SVN from GIT without all the history?

开发者 https://www.devze.com 2023-04-13 06:10 出处:网络
I\'m dealing with two repositories.A remote serv开发者_如何学编程er running SVN and my local git repo.

I'm dealing with two repositories. A remote serv开发者_如何学编程er 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.


You will want to take a look at git rebase -i http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

This will allow you to squash a branch history down to one commit message.

If you have two branches

  • master
  • *working_branch (this is the branch where you have a few commits)

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 then git checkout master and git merge working_branch back into master.

From master then do git svn dcommit

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号