For reasons to long to describe here, I created a local SVN repository, copied the contents of a remote repository, and make a total of 60 commits to it. In the mean time, the remote repository hasn't changed a single bit. Now I want to get those 60 commits in the remote repository. What is the best way to achieve this?
I've been looking for a solution. First thing I found was svnsync, but it will only work for a new empty repository.
Some similar questions were answered with 'use git-svn', without an explanation how this should work. The problem I get is that I end up with 2 unrelated branches in GIT. Using git-replace I should be able to mark the ancestor of the local branch in the remote branch, but in a small-scale test it results in a large number of merges. As a last resort I could write a shell-script that gets all patches from the local repository and apply them to the remote repository. It should be somewhere on the internet, but I can't find it.
In a future scenario I'd always use GIT to get a local repository, it would have saved a lot of trouble.
To elaborate on my small-scale git-svn test:
- create SVN repository svn-original, check out, make a few commits
- create SVN repository svn-local, copy contents of svn-original checkout, commit, make a few other commits
- since I'm on windows, use svn-serve to create a server for svn-original at the default port, and svn-local on port 1234
Then I did this in a console:
cd temp/git
git svn init --prefix=svn-original –R svn-original svn://localhost/ --stdlayout
git svn init --prefix=svn-local –R svn-local svn://localhost:1234/ --stdlayout
git svn fetch svn-original
git svn fetch svn-local
git checkout -b svn-original svn-original/trunk
git checkout -b svn-local svn-local/trunk
git log svn-local --oneline
# find the commit that adds code from the original
git log svn-original --oneline
# find the last commit
git-replace <first-local> <last-original>
This doesn't work: the last commit of svn-original is now shown in gitk as part of svn-local. Merging results in merge-conflicts, and dcommit fails.