git svn workflow - feature branches and merge

后端 未结 4 1961
北海茫月
北海茫月 2020-12-02 08:33

I am using git-svn with the following workflow now

git clone  #done once

subsequently when I work on a feature

4条回答
  •  日久生厌
    2020-12-02 09:22

    Instead of git-svn, you may use SubGit. It's a server-side tool which automatically synchronizes Subversion and Git repositories.

    You can use any Git workflow and any Git client available, no additional client tools needed.

    Considering your scenario:

    git branch featureZ
    git checkout featureZ
    # make edits for featureZ
    git commit
    git checkout master
    

    You can proceed as follows:

    1. Push feature branch entirely.

      git merge featureZ
      git push origin refs/heads/*
      
    2. Rebase a feature branch on top of master/trunk.

      git rebase featureZ
      git push
      
    3. Squash commits from a feature branch.

      git merge --squash featureZ
      git commit
      git push
      

    As soon as you push changes, SubGit hooks translate your changes into Subversion revisions.

    Some more details:

    • SubGit in many ways is more superior than git-svn — better merge-tracking translation, EOLs & mime-type support, etc.
    • SubGit needs local access to Subversion repository (it uses custom hooks);
    • SubGit is a commercial product with some free options (open-source and academic projects, small teams).

提交回复
热议问题