subversion to git migration

Post on 27-Jun-2015

741 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Talk I presented at the BigCommerce meetup recently

TRANSCRIPT

SVN to Git Migration

Technology

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

Migratingthe code

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.

svn-all-fast-export

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

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

svn-all-fast-export# svn­authorsanna.pomroy = Anna Pomroy <anna.pomroy@bigcommerce.com>chris.beckett = Chris Beckett <chris.beckett@bigcommerce.com>chris.boulton = Chris Boulton <chris.boulton@bigcommerce.com>

...

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

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!

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...

How are we using git?

SVN branching model

Trunk

Feature-X

RC-01

Feature-Y

1.0 1.2

MonTues MonTues

Time

Stability

RC-02

Hot

fix

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

Rome wasn'tbuilt in a day...

Identified issues

➔ svn:ignore. Create .gitignore

➔ Empty directories. Fill with .empty files

➔ Commit hooks. Use gitty for hook management.

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.

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”

Immediate Benefits

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

Questions?

top related