Good practice to use git together with svn

后端 未结 2 1447
深忆病人
深忆病人 2021-02-19 06:29

Subversion was popular several years ago, now git is becoming popular and more and more people want to replace Subversion with git.

Problem is that a lot projects were

2条回答
  •  旧巷少年郎
    2021-02-19 06:49

    Subversion is just like container to contain git

    Be sure to read the CAVEATS section coming with git-svn:

    CAVEATS

    For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server, and avoid all git clone/pull/merge/push operations between git repositories and branches.
    The recommended method of exchanging code between git branches and users is git format-patch and git am, or just 'dcommit’ing to the SVN repository.

    Running git merge or git pull is NOT recommended on a branch you plan to dcommit from.
    Subversion does not represent merges in any reasonable or useful fashion; so users using Subversion cannot see any merges you’ve made. Furthermore, if you merge or pull from a git branch that is a mirror of an SVN branch, dcommit may commit to the wrong branch.

    So you can adopt any merge and publication workflow with Git, as long as you leave the SVN branches you mirror alone (in term of merges or rebases).

提交回复
热议问题