1

it is my first attempt to make git-svn project. I have Debian server with direct access.

Info: - local SVN is one branch and i won't be doing any local or remote commits

What i want to archive:

  1. Create true GIT local repository. That's easy :-]

  2. Create SVN local copy(or git-svn repo ? i don't know witch will be better in this case) of http://miranda.googlecode.com/svn/trunk/ (one branch) and then automatically get all changes via some script that detect remote changes and run "svn update" after.

  3. Somehow get all "changes" one by one (files and commit messages) from local SVN repo to local GIT repo and a branch named "Miranda-svn". So when you look and the commits/log for this specific branch, you will see the same messages as http://code.google.com/p/miranda/source/list has.

  4. Push "Miranda-svn" branch to the remote github.com account, project name "Test", branch name "Miranda-svn"

  5. Merge branch "Miranda-svn" with "master"

Can somebody help me ? Is there some example of such setup ?

4

1 に答える 1

3

This is pretty straightforward with Git.

First "clone" the remote repository with git svn

git svn init --trunk=trunk http://miranda.googlecode.com/svn miranda
cd miranda
git svn fetch
git checkout -b Miranda-svn remotes/trunk 

Note: You may wish to limit the number of revisions fetched by using the -r start:end switch

Then add a new remote for github

git remote add origin git@github.com:myuser/test.git

Finally push changes to the github remote

git push origin Miranda-svn

To update Git branch with contents from SVN:

git checkout Miranda-svn # Just to be sure that we are on the correct branch
git svn rebase
git push origin Miranda-svn

Merge SVN changes to another Git branch:

git checkout master # Or whatever branch you want
git merge --no-ff Miranda-svn

NB! As SVN has linear history and the "svn" branch will be rebased on every "pull" you do not want to commit anything into Miranda-svn branch with this setup.

于 2012-07-29T21:41:58.313 に答える