All the cool kids use git these days but shifting gears for your way-way-back-then-started repo into git is an intimidating task, let alone scaring the entire team while everyone is busy getting their stuff done.
But you still want to learn git? there is no better way to that than using it every single day-isnt that how you became a pro at svn in the first place? so here comes git-svn to the rescue.
Its a real simple tool that goes bi-directional between git and svn and is so well done that sometimes its just prepending git in front of svn commands!
To start a git repo from svn is as easy as
1
|
|
If your svn repo is not using the standard layout of trunk/branches/tags, you can specify what they are using -T , -b , -t like so
1
|
|
Before you start making changes though, you might want to set up the annoying ‘ignores’. Just copy over svn ignore config into git with:
1
|
|
Ensure your checkout is pointing to the right repo
1
|
|
And now you can start exploring and committing to the local git repo using git commands like
1 2 |
|
Then comes the slight difference between real git repos and git-svn repos. you most likely heard about git pushing changes. with git-svn, you’d
1
|
|
to push changes to the svn repo. and there you go-you made your first commit to svn via git-irony!!
More to come on .gitconfig, branches, cherry-pick’ing etc. but let me suggest installing bash-completion right away so you can just tab-complete the commands instead of typing out in entirety each time-all about saving those precious strokes that so risk every software engineer to carpal tunnel!