• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Git As A Subversion Replacement
 

Git As A Subversion Replacement

on

  • 20,026 views

Gives an intro to git, from the perspective of subversion. Then goes on to show other git goodness.

Gives an intro to git, from the perspective of subversion. Then goes on to show other git goodness.

Statistics

Views

Total Views
20,026
Views on SlideShare
18,754
Embed Views
1,272

Actions

Likes
42
Downloads
493
Comments
2

31 Embeds 1,272

http://technicalpickles.com 966
http://knitinr.blogspot.com 107
http://www.slideshare.net 76
http://wiki.bcmoney-mobiletv.com 47
http://technicalpickles.dev 16
http://localhost 14
http://knitinr.blogspot.co.uk 6
http://knitinr.blogspot.ae 5
http://knitinr.blogspot.in 4
http://knitinr.blogspot.ro 4
http://translate.googleusercontent.com 3
http://webcache.googleusercontent.com 2
http://www.e-presentations.us 2
http://knitinr.blogspot.tw 2
http://knitinr.blogspot.de 2
http://knitinr.blogspot.cz 1
http://knitinr.blogspot.dk 1
http://knitinr.blogspot.ch 1
http://knitinr.blogspot.be 1
http://knitinr.blogspot.co.at 1
http://knitinr.blogspot.ie 1
http://knitinr.blogspot.com.au 1
http://localhost:81 1
http://209.85.135.104 1
http://knitinr.blogspot.co.nz 1
http://knitinr.blogspot.se 1
http://knitinr.blogspot.fr 1
http://knitinr.blogspot.jp 1
http://knitinr.blogspot.ca 1
http://knitinr.blogspot.sg 1
http://knitinr.blogspot.pt 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Git As A Subversion Replacement Git As A Subversion Replacement Presentation Transcript

    • git as a subversion replacement it’s kinda like subversion, but more awesome! Josh Nichols technicalpickles.com
    • Outline • Using how to use git in the same way you've gone accustomed to using subversion • Advantages of using git even just like subversion • Open source collaboration • Building rails apps on git Josh Nichols technicalpickles.com
    • Some initial setup • Need to setup ~/.gitconfig • Set things like email address and name • Can setup command aliases for more svn like commands Josh Nichols technicalpickles.com
    • ~/.gitconf [user] [color quot;branchquot;] email = quot;josh@technicalpickles.comquot; current = yellow reverse name = quot;Josh Nicholsquot; local = yellow [alias] remote = green st = status [color quot;diffquot;] co = checkout meta = yellow bold ci = commit frag = magenta bold [color] old = red bold branch = auto new = green bold diff = auto [color quot;statusquot;] status = auto added = yellow changed = green untracked = cyan Josh Nichols technicalpickles.com
    • Let’s review some subversion workflows Josh Nichols technicalpickles.com
    • Initial checkout svn repository checkout developer A developer B Josh Nichols technicalpickles.com
    • Commit and update svn repository update commit developer A developer B Josh Nichols technicalpickles.com
    • Branching svn repository cp sw developer A developer B Josh Nichols technicalpickles.com
    • Alright, let’s see the commands Josh Nichols technicalpickles.com
    • Initial checkout • subversion: • svn checkout http://somewhere.com/repo • git: • git clone http://somewhere.com/repo.git Josh Nichols technicalpickles.com
    • Initial checkout svn repository git repository clone checkout developer A developer B developer A developer B Josh Nichols technicalpickles.com
    • Differences between a checked-out repository • subversion: • keeps a copy of the last revision from repo • git: • keeps a copy of the entire repo Josh Nichols technicalpickles.com
    • Differences between a remote repository • subversion: • can grab any particular path in the repository • git: • can only grab the entire repository • if you copy a checked out repository somewhere, you can actually use it as a remote repository Josh Nichols technicalpickles.com
    • Adding a file • svn: • svn add path/to/file • git: • git add path/to/file Josh Nichols technicalpickles.com
    • Differences for adding • svn • used for adding new files • git • used for adding new files AND recording modifications to existing files Josh Nichols technicalpickles.com
    • Status • svn: • svn st • git: • git st Josh Nichols technicalpickles.com
    • Differences for status • svn: • tracks: unversioned, new, deleted, modified • git: • tracks: unversioned, new, deleted, modified, modified but not ‘add’-ed Josh Nichols technicalpickles.com
    • Committing • svn: • svn commit • git: • git commit • both: • can specify files to commit • can give commit message with -m Josh Nichols technicalpickles.com
    • Commit svn repository git repository commit commit developer A developer B developer A developer B Josh Nichols technicalpickles.com
    • Differences for committing • svn: • sends changes to remote repository • revision number is incrementing integer • git: • only commits to local repository • revision number is hash of the commit Josh Nichols technicalpickles.com
    • Pushing to a remote repository • svn: • svn commit • git: • git push Josh Nichols technicalpickles.com
    • Push svn repository git repository commit push developer A developer B developer A developer B Josh Nichols technicalpickles.com
    • Diff • svn • svn diff • git • git diff Josh Nichols technicalpickles.com
    • Differences for diff • svn • must be online • git • can be offline Josh Nichols technicalpickles.com
    • Reverting • svn • svn revert some_file • git • git checkout some_file • yeah, it’s not so obvious Josh Nichols technicalpickles.com
    • Differences for reverting • git • you don’t ‘revert’ as much as you ‘checkout’ a version of the last committed change Josh Nichols technicalpickles.com
    • Updating • svn • svn update • git • svn pull Josh Nichols technicalpickles.com
    • Update svn repository git repository update pull developer A developer B developer A developer B Josh Nichols technicalpickles.com
    • Conflict resolution • Mostly the same • <<<<< • ===== • >>>>> Josh Nichols technicalpickles.com
    • Branching • svn • svn cp . http://somewhere.com/repo/branch/blarg • svn sw --relocate http://somewhere.com/repo/ branch/blarg . • git • git branch blarg • git checkout blarg Josh Nichols technicalpickles.com
    • Branching svn repository git repository checkout -b cp sw developer A developer B developer A developer B Josh Nichols technicalpickles.com
    • Differences for branching • svn • makes changes immediately to remote repo • git • local repository only • ‘git push origin blarg’ to send to remote Josh Nichols technicalpickles.com
    • Summary so far • There are a lot of similarities between svn/git • Main differences so far: • online v. offline • commits v. push • changesets • Questions? Josh Nichols technicalpickles.com
    • Git hosting solution • Self-hosted • by hand • gitosis • Hosted • gitorious • repo.or.cz • GitHub Josh Nichols technicalpickles.com
    • Ok, so what’s better about git? Josh Nichols technicalpickles.com
    • My stash • svn • svn diff > changes.diff • svn revert -R . • git • git stash save Josh Nichols technicalpickles.com
    • Offline committing • Extremely, extremely useful • Something appealing about committing from the beach without internet access Josh Nichols technicalpickles.com
    • Branching • It actually works really well • Can merge between branches as much as you want • Don’t need to worry about specific revisions • Encourages more branching • fix branches, feature branches Josh Nichols technicalpickles.com
    • Using a fix branch • git checkout -b amazing_fixes • make changes • git commit -m “I fixed the hell out of this bug” • git checkout master • git merge amazing_fixes • git push Josh Nichols technicalpickles.com
    • Distributed • Can work with multiple remote repositories • push or pull Josh Nichols technicalpickles.com
    • One repository to rule them all Push Push Core contributor Core contributor Email patch Pull Pull Random contributor Random contributor Pull Random contributor Josh Nichols technicalpickles.com
    • Subversiveness • Play with subversion and cvs repositories using git! • git svn clone http://somewhere.com/repo • git svn dcommit • replays all your git commits as svn commits • git svn rebase • replays remote commits as git commits locally Josh Nichols technicalpickles.com
    • Open source collaboration • With subversion, only ‘authorized’ users can ‘commit’ • As a non-committer, can’t make incremental changes towards a big refactorings • Typically would send patches around... problematic to make sure they are up to date Josh Nichols technicalpickles.com
    • Open source collaboration • git and github solve all these concerns • behold, live demo! Josh Nichols technicalpickles.com
    • Rails development • Rails 2.1 it supports out of the box (script/install) • Piston 1.9.x supports it • LIVE DEMO!!!!1one Josh Nichols technicalpickles.com
    • Fin. Josh Nichols technicalpickles.com