Push a git-svn local repo to a different svn remote repo that already exists
I'm trying to integrate two svn repos. One is a kind of fork of the other. But it's not exactly a fork so i can't find a common point.
I've cloned both repos in one local git-svn repo, each repo in one branch, and i have already integrated both repos b开发者_StackOverflowut know i need to push the changes to one of the original repos. I trying to figure the best workflow for upload the changes maintaining the history. I think that it should be something like this:
# Move the trunk of the remote repo to a branch
$ svn move svn+ssh://host.example.com/repos/project/trunk svn+ssh://host.example.com/repos/project/branches/NAME_OF_BRANCH -m "Creating a branch of project"
# Make a commit that explains the change that is going to happen
# Change to the branch that tracks the remote repo, and fetch the changes
$ git checkout myBranch
$ git svn rebase
# The folder should be empty at this point
# Upload the local changes to the trunk of the remote repo
$ git merge integrationBranch
# ¿rewrite the history?
# Upload it
$ git svn dcommit
I can't find a better explanation but i think that git svn dcommit uses git-svn-id of the last commit to figure which is the url to push, so i guess that in some point i should rewrite the history, but i don't know how.
Also if anyone can provide a way to make a test before really upload the changes will be great.
After some research i found how to rewrite the history based on this post. To change the git-svn-id i use:
git filter-branch --msg-filter 'sed "s/git-svn-id:.*//g"' myBranch
精彩评论