What is the best practice here?
The repository in question is here: http://svn.osqa.net/svnroot/osqa/
# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...
The high-level workflow for migrating from SVN to Git is as follows: Prepare a migration environment. Convert the source SVN repository to a local Git repository. (Optional) Synchronize the local Git repository with any changes from SVN repository while developers continue using SVN.
The git svn clone command transforms the trunk, branches, and tags in your SVN repository into a new Git repository. Depending on the structure of your SVN repo, the command needs to be configured differently.
I'd clone everything in the first place, just in case you need the other branches later, with:
git svn clone --stdlayout http://svn.osqa.net/svnroot/osqa/
In this case I can't see any particular reason not to, since even with all the branches a git svn clone
of the repository only ends up being 11 megabytes. It'll make things easier later if you are interested in the other branches.
The problem is that subversion branches are exposed (usually, and in your case) via a standard naming convention of TOPLEVEL/branches/...
. The way git
does it is not so explicit - that is, if you do a git checkout BRANCH_NAME
, the branch files are "swapped in" to your current working directory.
With this in mind, I'd suggest only importing trunk, and then importing all the directories in the TOPLEVEL/branches/branchname
directory as git branches as you need them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With