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,
staging. This is all fine.
- How often to comment when committing code?
- Multiple coders on the same source
- Tortoise - is it possible to ignore new folder before committing it?
- PHP: exec(svn commit) is not returning any errors nor working
- svn:ignore property during import
- SVN - automate merge of trunk into branch
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
Can someone explain steps how this can be done? (I am fairly new to Git)
Thanks in advance.
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)