开发者

How do I use git-svn to merge changes from trunk to a branch in svn?

I've seen people suggest to use git-svn to do the merge and commit it back to svn.

I'm looking for a good step by step guide.

  • Is it worth the trouble or should I just use svn to do it.
  • Will people see I've used git and is the开发者_如何学编程re any meta data about the merge in svn?
  • Can I do a clone of trunk and 1 branch I select?
  • Do I need a full clone or can I import it from the point where the branch was made?


I have used the instruction in this post with much success. http://justaddwater.dk/2009/03/09/using-git-for-svn-repositories-workflow/

I use git to merge between branches then commit them to the svn repo. This does not follow the merge procedure for svn and so this can be problem for other users. the svn:merge property is not set

git-svn does not leave any evidence in the svn repo that you are using git-svn.


Is it worth the trouble or should I just use svn to do it.

I think it depends on how you much information you want to retain in SVN. If you do the merge using git, I believe SVN will not know where the changes came from, or in other words, it will look like the SVN trunk and branch is still separate.

Will people see I've used git and is there any meta data about the merge in svn?

No, it would just look like a new commit onto trunk.

Can I do a clone of trunk and 1 branch I select?

If you mean clone your git-svn into a new git repo, then yes. Just clone the git-svn and delete the extraneous branches, or do that directly in the git-svn repo before you clone.

Here is a post how to convert an SVN repo to a git one. I think most of it would apply in this situation.

Do I need a full clone or can I import it from the point where the branch was made?

Git clones will usually be full clones, unless you use the --depth option. If you want to throw away the previous history, you can always squash all the commits into an older one, or just delete the .git directory and init a new repo.


I have read a few articles of people suggesting this, but I think it should only be used if you both work with GIT and SVN for the same code (local repo with git and hosted repo with svn). I would advise you to just stick to your VCS and get a proper merge tool like BeyondCompare or Kaleidoscope

A small tutorial about git-svn can be found at

http://flavio.castelli.name/howto_use_git_with_svn

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜