SVN to Git. New branch with new source

We’re moving from SVN to Git.

I setup empty Git repo on our server. Set up a working directory on my local machine and downloaded the complete source from SVN repo to this local folder (Working directory). I pushed all these files to master branch and created two branches, dev and staging. This is all fine.

Now I want to create a new branch called v1.0 with completely different source (lot of new features).
My plan is to create a new working directory (local folder) called v1.0 and import the source (from another SVN repo) to this folder. I want to point this folder to the v1.0 branch.

Can someone explain steps how this can be done? (I am fairly new to Git)

Thanks in advance.

  • How to Integrate TortoiseSVN with Eclipse IDE?
  • Add external project to subversion repository
  • Internet connection Drops during an SVN commit
  • How to 'fix' a SVN branch/tree conflict?
  • Easy merging in svn using git-svn
  • How to change where Subversion repositories are stored?
  • How to switch svn branches using git-svn?
  • Import an existing SVN project into Eclipse
  • 2 Solutions collect form web for “SVN to Git. New branch with new source”

    If the project is completely different it has more sense to create a separate git repo. The main philosophy change while moving from svn to git is to prefer to have multiple repositories for each logical module (e.g. library, program, etc).

    However, if you really want to have a single repo with git, you could create an orphan branch: git checkout --orphan v1.0.

    if i understand correctly, that you are currently not at all concerned with keeping the svn-history in your git repository, why not do something as simple as:

    $ cd project
    $ git checkout -b v1.0
    $ rm all files not needed
    $ # the above could also just be "rm *", just be careful to not delete .git
    $ cp -r /path/to/project-1.0/* .
    $ git add .
    $ commit -a -m "imported v1.0"

    git should figure out by itself which files have not been touched, or renamed, or …

    and having all in one repository, makes it easy to cherrypick (where this is possible)

    Git Baby is a git and github fan, let's start git clone.