Skip to content

Instantly share code, notes, and snippets.

@forceedge01
Created December 27, 2017 18:17
Show Gist options
  • Save forceedge01/799a69707c6d418c78232af2abc26cd7 to your computer and use it in GitHub Desktop.
Save forceedge01/799a69707c6d418c78232af2abc26cd7 to your computer and use it in GitHub Desktop.
Sync svn to git repo from scratch
svn checkout -r HEAD <svn repo url> <dir>
cd <repo>
git init
git remote add origin <origin>
git fetch origin
# In order to get this working, we have to have an initial commit. So commit one of the files but don't push yet.
git add build.xml
git commit -m "Commit to get svn to git sync functional"
# This removes any of the untracked files being put in.
git reset --hard origin/master
git merge origin/master
svn update
git add .
git commit -m "Changes pulled from svn repo."
git push --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment