Subgit: avoid synchronizing git branches on svn

I'm trying to use SubGit , but I had a problem with branches: I need branches created under Git to live and die only inside Git. I found this: SubGit: how to exclude branches? but he says

Problems arise from commits: if commit A is the result of merging the foo branch into master, then SubGit creates the / foo branches on the Subversion side for the corresponding commit A parent. If you prefer not to include the generated SubGit branches in the / * branch namespace, also consider using some special branches on the Subversion side as well

I donโ€™t want to mess with SVN because I value Subgit and I donโ€™t want to change anything in SVN. I think I could achieve my goal (which means that for SVN there will only be a unified history, and not a Git branch) rebasing before clicking on the Git repository, but I am afraid that this may lead to conflicts when returning to SVN. Any idea on how I can get around this without waiting for SubGit version 2.1 (claimed to be doing what I want, but not in the near future) cit from the related answer: it going to take some time before we implement it )?

+3
source share
1 answer

SubGit only synchronizes the branches that you specified in the SubGit configuration file. By default they are:

  trunk = trunk:refs/heads/master branches = branches/*:refs/heads/* shelves = shelves/*:refs/shelves/* tags = tags/*:refs/tags/* 

So, if you use a different namespace, for example. refs / heads / nosync / *, branches in it will not be synchronized.

Or you can use refs / heads / * for regular branches (which are not in sync) and set up a special refs / heads / sync / * namespace for synchronization:

  trunk = trunk:refs/heads/sync/master branches = branches/*:refs/heads/sync/* shelves = shelves/*:refs/shelves/* tags = tags/*:refs/tags/sync/* 

Please note that long branch names (e.g. refs / heads / sync / master) do not cause inconvenience, because after cloning such a Git repository you can assign your own local refs / heads / * links with short names to track branches with long names from one or another namespace. That is why I think this is a good solution for you.

+5
source

Source: https://habr.com/ru/post/945168/


All Articles