adi rohan
adi rohan

Reputation: 806

Merge svn branch to new git branch

We are moving from a svn repository to a git repository

Although the svn trunk was migrated, the branches were not(svn server is maintained by a different team).

So I am left with a local copy of svn branch which is almost 6 months older than the current git repository.

If you want to ask why 6 months, it was a huge feature so 2 months went into development and rest 4 months were wasted because the feature could not be released due to some blockers.

How can I now merge my local svn branch which has these bunch of changes on 6 months old code to a git branch ?

Upvotes: 3

Views: 1601

Answers (1)

VonC
VonC

Reputation: 1323203

You could

  • git-svn that SVN repo into a git repo
  • add that new git repo as a remote of your existing git repo and fetch it

    cd /path/to/existing/repo
    git remote add gitsvn /path/to/gitsvn/repo
    git fetch gitsvn
    
  • create a new branch in your current Git repo at a point you estimate that 6 month effort might have started

  • cherry-pick the fetched commit onto that new branch
  • finally, merge that new Git branch in your master branch

Upvotes: 3

Related Questions