Git Example: Migrate Files from SVN to Git

# Export project from SVN into a local directory, e.g. /c/stage/svn
 
# Create a new git repo, e.g. myproj.git
cd /c/vc
git init --bare myproj.git
 
# Now clone the newly created repo in a work directory, e.g. /c/work
cd /c/work
git clone file:///c/vc/myproj.git
 
# Move files exported from svn to the git work directory
cd /c/work/myproj
mv /c/stage/svn/trunk/myproj/* .
 
# Add and commit svn files to git repo
git add -A
git commit -m "Initial from svn."
 
# Push changes
git push origin master
 
# Export a git repo
git archive --format zip --output /c/stage/git-proj.zip master
This entry was posted in git, svn and tagged , . Bookmark the permalink.