1

I have the following scenario:

I am porting a big repo from which some catalogs I would like to separate into git repositories with independent/separate history, e.g.:

git svn clone  --trunk=https://svne1.XXX.XXX.com/XXXX/svnroot/trunk/ https://svne1.XXX.XXX.com/XXXX/svnroot/trunk/src/project1 --username myname --no-metadata -A ~/Documents/users.txt

This will create a git repository with extracted source code from src/project1 under the trunk and with separate history and I will be able to push it anywhere I desire.

But I need (for some time) to be able to push to svn repo as well and taking into account that I have downloaded only the history of one directory from my project and not the trunk it is not so trivial to allow:

git svn rebase
git svn dcommit

How can I do this then? Having extracted multiple repos from svn to git and commit to both git and svn (having in mind that history in those smaller git repos are different (subset) of history in svn)

EDIT:

After launching running the clone operation and then git svn rebase I would get:

git svn rebase
Unable to determine upstream SVN information from working tree history
Patryk
  • 22,602
  • 44
  • 128
  • 244
  • Why is it not so trivial to allow? Technically there should be no issue I guess. You just do `git svn dcommit` from your git-svn copy. – Mykola Gurov Jan 22 '15 at 11:53

1 Answers1

2

You should not use --no-metadata if plan staying in sync:

svn.noMetadata, svn-remote..noMetadata

       This gets rid of the git-svn-id: lines at the end of every commit.

       This option can only be used for one-shot imports as git svn will
       not be able to fetch again without metadata.

I don't think you also need to specify --trunk unless you want to use branches, and if so - would expect trunk to be below the main url, not above.

Mykola Gurov
  • 8,517
  • 4
  • 29
  • 27
  • This will checkout all the repo data and files from whole repo not from the subdirectory specified, e.g. `https://svne1.XXX.XXX.com/XXXX/svnroot/trunk/src/project1` – Patryk Jan 28 '15 at 16:09
  • @Patryk did you try `git svn clone https://svne1.XXX.XXX.com/XXXX/svnroot/trunk/src/project1` ? I would expect it to fetch what you intend to. – Mykola Gurov Jan 28 '15 at 18:44