2

My scenario:

Project was converted from SVN to Git (via somewhat older version of git-svn):

SVN branches were converted to branches:

for branch in `git branch -r`; do
    git branch $branch refs/remotes/$branch
done

SVN tags were converted to tags:

git for-each-ref refs/remotes/tags | while read r; do
   sha1=$(git rev-parse $r)

   # stuff for formatting of committer, etc

   git tag ... $sha1

   # Remove the tags/* ref
   git update-ref -d $r
done

Problem:

There were a handful of commits and tags that were committed to SVN before we fully switched over to Git.

How do I get just those commits and tags added to the Git repo?

I've tried doing git svn init, git svn fetch, but it seemed to be repeating the whole process - but I obviously need the git commits to be the same otherwise I've created a disjoint branch.l

2
  • Have there been commits and fixes to the git repo since the conversion? Commented Apr 8, 2016 at 19:53
  • @TriskalJM Yes, but not in any way that should create a divergent branch. Commented Apr 8, 2016 at 20:00

1 Answer 1

1

Use the command git svn rebase to pull in new commits.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.