subversion to git migration

18
SVN to Git Migration

Upload: tim-massey

Post on 27-Jun-2015

741 views

Category:

Technology


2 download

DESCRIPTION

Talk I presented at the BigCommerce meetup recently

TRANSCRIPT

Page 1: Subversion to Git Migration

SVN to Git Migration

Page 2: Subversion to Git Migration

Technology

➔ Gitolite.➔ Atlassian Suite.➔ Internal system ”Octopus”.

Page 3: Subversion to Git Migration

Migratingthe code

Page 4: Subversion to Git Migration

git-svn

➔ Slow...➔ Didn't handle shallow merges well.➔ Our old branches didn't map well.➔ Works fine for small repos.➔ Not right for our repo.

Page 5: Subversion to Git Migration

svn-all-fast-export

➔ Faster.➔ Direct access to git from C libs.➔ Easier to configure.

Page 6: Subversion to Git Migration

svn-all-fast-export# rules­mapcreate repository bigcommerceend repository 

match /trunk/ repository bigcommerce branch master 

end match...

match /branches/([^/]+)/repository bigcommercebranch \1

end match...

match /tags/7.3.23/repository bigcommercebranch refs/tags/7.3.23annotated true

end match

Page 7: Subversion to Git Migration

svn-all-fast-export# svn­authorsanna.pomroy = Anna Pomroy <[email protected]>chris.beckett = Chris Beckett <[email protected]>chris.boulton = Chris Boulton <[email protected]>

...

# import commandsvn­all­fast­export ­­identity­map svn­authors ­­rules map ­­add­metadata /var/svn/bigcommerce

Page 8: Subversion to Git Migration

svn-all-fast-export

➔ Problem: Post migration branch amnesia. Only affected some branches.

➔ Solution(s): Patch from the original svn branch. Rebranch in git, resolve lots of conflicts and

pay close attention!

Page 9: Subversion to Git Migration

svn-all-fast-export

➔ Problem: Wrong revision used to create a branch on

import.➔ Solution:

Fix it in the source & submit a patch! Check & double check...

Page 10: Subversion to Git Migration

How are we using git?

Page 11: Subversion to Git Migration

SVN branching model

Trunk

Feature-X

RC-01

Feature-Y

1.0 1.2

MonTues MonTues

Time

Stability

RC-02

Hot

fix

Page 12: Subversion to Git Migration

Gitflow branching model

Develop

Feature/x

Release/1.0

Feature/y

1.0

1.3

MonTues MonTues

Time

Stability

Release/1.3

master

1.2 1.3

Page 13: Subversion to Git Migration

Rome wasn'tbuilt in a day...

Page 14: Subversion to Git Migration

Identified issues

➔ svn:ignore. Create .gitignore

➔ Empty directories. Fill with .empty files

➔ Commit hooks. Use gitty for hook management.

Page 15: Subversion to Git Migration

Unidentified problems

➔ ”Time & tide waits for no man”. We were fixing the deployment system

”Octopus” on the day. Last minute cherry-picks to tags/branches to

get them working.

Page 16: Subversion to Git Migration

Why did we do it?

”f**k; I keep typing git status”

”Maybe we should evaluate git more”

”...what if anything is blocking us from

switching to git for source control?”

”I miss my git staging area already”

Page 17: Subversion to Git Migration

Immediate Benefits

➔ Decentralised, remote work.➔ Much, much faster.➔ Staged commits, stashes.➔ Flexible & powerful cmd line.

Page 18: Subversion to Git Migration

Questions?