Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently, I'm try to setup git front-end to the Subversion repository.

My Subversion repository is a single large repository which consists of several co-related projects:

  |-- project1
  |   |-- branches
  |   |-- tags
  |   `-- trunk
  |-- project2
  |   |-- branches
  |   |-- tags
  |   `-- trunk
  `-- project3
      |-- branches
      |-- tags
      `-- trunk

Because it's sometimes needs to move files between different projects, so I don't want to break the repository to separate ones.

I'm going to use git-svn to setup a git front-end, but I don't see how to exactly mapping the svn to git structure. The two systems treat branches and tags very different and I doubt it is possible.

To simplify the problem, I would just git svn clone the whole root directory and let branches/tags/trunk directories just sit there. But this will definitely result in too many files in branches and tags directories. In Subversion, it's easy to just set the depth of checkout to immediates, which will only checkout the branch/tag titles, without the directory contents. but I don't know if this can be done in git.

The git-svn messed me up. I hope there's more elegant solution.

share|improve this question
up vote 0 down vote accepted

There really isn't a good way to do this. Git does not support partial checkouts. So either you keep it all in one repository and check it all out at once, or you use submodules and keep the file moving to a minimum. See also on the latter point.

share|improve this answer

You don't have to checkout the entire history however. The following statement only checks out the most recent changes:

git clone --depth 1

Such a checkout is NOT good for editing and checking back in, but it is great for sharing the current code base or for deploying to production, etc.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .