Skip to content

Instantly share code, notes, and snippets.

@TigerWolf
Last active November 10, 2016 03:24
Show Gist options
  • Save TigerWolf/c0ad709d05dc9dbd4a26 to your computer and use it in GitHub Desktop.
Save TigerWolf/c0ad709d05dc9dbd4a26 to your computer and use it in GitHub Desktop.
Using git-svn
# Initial Checkout/Clone
git svn clone https://svn.yourdomain.com --stdlayout destination_folder_name
# stdlayout is used if your SVN follows the standard
# layout /trunk /branches /tags and will add the branches and tags as git branches.
# Do some dev work
git add .
git commit -m "commit message"
git stash # Stash uncommitted files
git svn fetch # Get new SVN changes
git svn rebase # Rebase new SVN changes (will also do fetch if you want to skip a step)
git svn dcommit –dry-run # Check things like what branch you are sending to and SVN url
git svn dcommit # Send commits to SVN
git stash apply # Re-apply unstaged files
## Changing Branches
git checkout -b RELEASE-0.12-svn origin/RELEASE-0.12
# will connect with a remote svn branch named ‘RELEASE-0.12′
# -n will show which svn branch you will commit into:
git svn dcommit --dry-run
## Tips and Tricks
# Add svn ignore to git local ignore.
git svn show-ignore >> .git/info/exclude
#Create a shallow clone for big repositories
git svn clone -s -r604:HEAD http://svn.xxxxxx.com/repos/ -T trunk -b branches -t tags
# Create a svn branch
git svn branch -n -m "Branch for authentication bug" auth_bug
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment