migrating from subversion to git and github

98
VERSION CONTROL REINVIGORATED from Subversion to Git and GitHub

Upload: matthew-mccullough

Post on 18-Feb-2017

531 views

Category:

Technology


0 download

TRANSCRIPT

VERSION CONTROL REINVIGORATEDfrom Subversion to Git and GitHub

VERSION CONTROL REINVIGORATEDfrom Subversion to Git and GitHubfrom Subversion to Git and GitHub

Who is Matthew?

Open source contributor

Build tool and continuous delivery author

5 year Git evangelist

VP of Training at GitHub

The Change

SVN ☞ GIT

— Every manager, ever

If it isn't broke,don't fix it.

The Radar

July 2011

Technology Radar

Prepared by the ThoughtWorks Technology Advisory Board

http://www.thoughtworks.com/radar

July 2011

Technology Radar

Prepared by the ThoughtWorks Technology Advisory Board

http://www.thoughtworks.com/radar

Tools30. Subversion31. Git32. Infrastructure as code33. Github34. Caching reverse proxies35. Splunk36. Mercurial37. Message buses without smarts38. NoSQL39. Next gen test tools40. New Relic beyond Rails41. TLB42. Powershell

43. Selenium 2 testing of mobile websites44. Deltacloud45. Vagrant46. API management services47. jQuery Mobile48. Backbone.js49. Sonar50. Open source bI tools51. Gradle52. Cross platform mobile toolkits53. ESB54. VCS with “implicit workflow”55. Code in configuration

26

16

13

22

12

5

3

32

36

46

5345

44

3739

35

38

304

6

56 76695857

7

15 14

25

29

28

27

21

23

17

19

24

18

20 11

9

2

10

3133

42 41

40 50

47

4849

51 54

43

55

52

34

18

New or MovedNo change

Techniques1. Progressive enhancement2. Automate database deployment3. Platform roadmaps4. Evolutionary database5. Emergent design6. Visualization and metrics7. Coding architects8. Evolutionary architecture9. DevOps10. Simple performance trending11. Continuous delivery12. Concurrency abstractions and patterns13. Acceptance test of journeys14. Categorization & prioritization of technical debt15. Continuous deployment16. Capability modeling17. Thoughtful caching18. Iterative data warehousing

19. Build your own radar20. Event API’s21. Event driven business intelligence22. Smart systems23. Event sourcing24. Decision driven BI25. Scrum certification26. Database based integration27. Procedure oriented integration28. Feature branching29. Manual infrastructure management

Tools30. Subversion31. Git32. Infrastructure as code33. Github34. Caching reverse proxies35. Splunk36. Mercurial37. Message buses without smarts38. NoSQL39. Next gen test tools40. New Relic beyond Rails41. TLB42. Powershell

43. Selenium 2 testing of mobile websites44. Deltacloud45. Vagrant46. API management services47. jQuery Mobile48. Backbone.js49. Sonar50. Open source bI tools51. Gradle52. Cross platform mobile toolkits53. ESB54. VCS with “implicit workflow”55. Code in configuration

26

16

13

22

12

5

3

32

36

46

5345

44

3739

35

38

304

6

7

15 14

25

29

28

27

21

23

17

19

24

18

20 11

9

2

10

3133

42 41

40 50

47

4849

51 54

43

55

52

34

18

New or MovedNo change

Techniques1. Progressive enhancement2. Automate database deployment3. Platform roadmaps4. Evolutionary database5. Emergent design6. Visualization and metrics7. Coding architects8. Evolutionary architecture9. DevOps10. Simple performance trending11. Continuous delivery12. Concurrency abstractions and patterns13. Acceptance test of journeys14. Categorization & prioritization of technical debt15. Continuous deployment16. Capability modeling17. Thoughtful caching18. Iterative data warehousing

19. Build your own radar20. Event API’s21. Event driven business intelligence22. Smart systems23. Event sourcing24. Decision driven BI25. Scrum certification26. Database based integration27. Procedure oriented integration28. Feature branching29. Manual infrastructure management

Tools30. Subversion31. Git32. Infrastructure as code33. Github34. Caching reverse proxies35. Splunk36. Mercurial37. Message buses without smarts38. NoSQL39. Next gen test tools40. New Relic beyond Rails41. TLB42. Powershell

43. Selenium 2 testing of mobile websites44. Deltacloud45. Vagrant46. API management services47. jQuery Mobile48. Backbone.js49. Sonar50. Open source bI tools51. Gradle52. Cross platform mobile toolkits53. ESB54. VCS with “implicit workflow”55. Code in configuration

26

16

13

22

12

5

3

32

36

46

5345

44

3739

35

38

304

6

7

15 14

25

29

28

27

21

23

17

19

24

18

20 11

9

2

10

3133

42 41

40 50

47

4849

51 54

43

55

52

34

18

New or MovedNo change

Techniques1. Progressive enhancement2. Automate database deployment3. Platform roadmaps4. Evolutionary database5. Emergent design6. Visualization and metrics7. Coding architects8. Evolutionary architecture9. DevOps10. Simple performance trending11. Continuous delivery12. Concurrency abstractions and patterns13. Acceptance test of journeys14. Categorization & prioritization of technical debt15. Continuous deployment16. Capability modeling17. Thoughtful caching18. Iterative data warehousing

19. Build your own radar20. Event API’s21. Event driven business intelligence22. Smart systems23. Event sourcing24. Decision driven BI25. Scrum certification26. Database based integration27. Procedure oriented integration28. Feature branching29. Manual infrastructure management

26

16

13

22

12

5

3

32

36

46

5345

44

3739

35

38

304

6

56

6174

76

65

695857

7

15 14

25

29

28

27

21

23

17

19

24

18

20 11

9

2

10

807560

3133

42 41

40 50

47

4849

51 54

43

55

52

34

18

New or MovedNo change

Categorization & prioritization of technical debtContinuous deploymentCapability modelingThoughtful cachingIterative data warehousing

Migration Tools

git-svn

git-svn

Core Git feature

$ git svn clone -s http://yourhost.com/reporoot/

git-svn

Consumes an authors email mapping file

git-svn

Migrates Subversion tags to Git branches

svn2git

$ svn2git http://matthew.com/svnrepos/project1

importing to git

# Publish one branch$ svn2git http://matthew.com/svnrepos/project1$ git remote add origin https://github.com/you/project1$ git push origin master

# Publish all branches and tags

$ svn2git http://matthew.com/svnrepos/svnproject1$ git clone file://yourpath/svnproject1 gitproject1$ cd gitproject1$ git remote add origin https://github.com/you/project1$ git push --mirror origin

Serving SVN from Git

Data Structures

— No engineer, ever

Wow!Version control!

DAG

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

Δ Δ

ΔΔ ΔΔΔ

Checkin

Checkin Checkin Check

in

Che

ckin

Che

ckin

Che

ckin

Check

in

Checkin

Checkin

CheckinDelta storage gets slower as the history of a file gets longer

Copy of the entire tree per commit

Why?

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

hard link to existing identical blobs

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File Cß

zlib deflates each blob at commit

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

zlib deflates the entire repo

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

v1 v2 v3 v4

File A

File B

File C

File A

File B File B

File C

v5

File A

File BFile B

File A File A

File C File C File C

Act I

2100 MB became 205 MB

refs

centralized VCSs use sequential revision numbers

Git uses a SHA-1 hash

40 hex characters (20 bytes)

9AB223D28B1AA46EF1780B22F304982E39872C34

9AB223D28B1AA46EF1780B22F304982E39872C34

<html><body>

<p>This is a test</p><img src="http://ai.com/icon.gif">

</body></html>

<html><body>

<p>This is a test</p><img src="http://ai.com/icon.gif">

</body></html>

9AB223D28B1AA46EF1780B22F304982E39872C34

‣Blob

‣Tree

‣Commit

‣Tag

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

treetree: 7e8b1 webblob: 9ab16 index.html

a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js

7e8b1commit

tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the web content.

c67db

blob<html>

<body></body></html>

9ab16

blob//Some more javascriptvar renderSize

51d22

blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB

8d162

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

v1 v2 v3

committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:

Major refactoringof the Javascript renderingengine.

c67db

committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:

Minor update to HTML

9bd21

committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:

New language transations

1c2d7

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

RELEASE_1.0 HEAD

bug979branch

commitc67db

commit9bd21

commit1c2d7

commit8c2d1

commit1bdcd

commit2daa1

Git Highlights

Local commits

Content Tracking

simpler Merges

Start now

git-svn conversion to Gitgit-svn bridge to SVNGitHub SVN URLs

Conversion Options

Thanks!