Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Distributed Developer Workflows using Git

Susan Potter
August 01, 2011
170

Distributed Developer Workflows using Git

This meetup I will be walking the audience through how to setup, configure and maintain distributed development workflows using Git (the distributed VCS developers either love or hate). Much of the workflows suggested here will be applicable to other dVCSes like Mercurial, Darcs and Bazaar.

This will be a light, interactive taster of the chapter I am writing for "The Architecture of Open Source Applications, volume 2" that will be coming to an ebook reader or bookshelf near you in the Autumn of 2011. Proceeds from book sales go to Amnesty International.

Susan Potter

August 01, 2011
Tweet

Transcript

  1. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial
  2. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management
  3. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion)
  4. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model)
  5. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model) • Gatekeeper Workflows (enterprise release management)
  6. Scope of Talk • How does Git differ. . .

    ? CVS, Subversion, Perforce, Mercurial • Gitting Started Locally Server configuration management • Centralized Remote (a.k.a. a better Subversion) • Forking Workflows (the GitHub model) • Gatekeeper Workflows (enterprise release management) • Deployment Strategies? (scalable distributed deployment)
  7. VCS Dimensions Delta DAG Local RCS cp -r or hard

    links Centralized CVS, Subversion, Perforce ? Distributed Mercurial, Darcs Git, Bazaar
  8. Gitting Started Locally (1/4) Initializing local repo inside working directory

    • git init • git config user.email “user@domain”
  9. Gitting Started Locally (1/4) Initializing local repo inside working directory

    • git init • git config user.email “user@domain” • git config user.name “Your Name”
  10. Gitting Started Locally (2/4) $GIT_DIR => .git/ • branches •

    hooks • objects • refs • config & info
  11. Gitting Started Locally (3/4) $GIT_INDEX => .git/index • staging area

    • add files before commit • can even add “patches”
  12. Centralized Workflow (1/3) Adding a remote • git init bare

    Create remote “bare” repo • Setup server authN/authZ e.g. $HOME/.ssh/authorized_keys, PAM, LDAP, etc.
  13. Centralized Workflow (1/3) Adding a remote • git init bare

    Create remote “bare” repo • Setup server authN/authZ e.g. $HOME/.ssh/authorized_keys, PAM, LDAP, etc. • git remote add <name> <URL> Add remote to local repository
  14. Centralized Workflow (2/3) Sharing to remote • git pull <remove>

    <branch> Pull from <remote> <branch> • git push <remote> <branch> Push to <remote> <branch>
  15. Forking Workflow (1/2) Forking remote repository. . . • cp

    -r <orig.repo> <forked.repo> Basically just a straight copy is necessary
  16. Gatekeeper Workflow (1/2) Gatekeeper remote repository. . . • git

    init bare Basically just create a bare Git repo and let gatekeeper curate and selectively push
  17. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with

    new release. . . • git bundle create <file.bundle> <branches,tags,etc> Creating a bundle with those branches, tags and/or commit range
  18. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with

    new release. . . • git bundle create <file.bundle> <branches,tags,etc> Creating a bundle with those branches, tags and/or commit range • git bundle verify <file.bundle> Verify bundle is valid and will apply cleanly to deployed repository
  19. Deployment Workflows (1/2) Distributed systems deployment could bundle rollback with

    new release. . . • git bundle create <file.bundle> <branches,tags,etc> Creating a bundle with those branches, tags and/or commit range • git bundle verify <file.bundle> Verify bundle is valid and will apply cleanly to deployed repository • git bundle unbundle <file.bundle> Unbundling subset of repository on deployment node