SlideShare a Scribd company logo
1 of 55
Git
For the Android Developer
AnDevCon 2011 : Tony Hillerson
#AnDevCon #effectiveui
http://www.slideshare.net/thillerson/scm-for-android-developers-using-git
About Me
• Worked with Android and Git for a few years now
• O’Reilly Screencaster: Developing Android Applications
  • http://training.oreilly.com/androidapps/
  • http://training.oreilly.com/androidapps2/
• Tech Reviewer:
Preliminaries
Getting Git and Getting Set Up
What’s a Git?

 A completely ignorant, childish person with no manners.
                                                               - http://urbandictionary.com




                 Linus Torvalds
                 http://en.wikipedia.org/wiki/Linus_Torvalds
What’s a Git?


     Git is a free & open source, distributed version
    control system designed to handle everything from
   small to very large projects with speed and efficiency.
                                              - http://git-scm.com
Getting Set Up on Mac
• Homebrew - http://mxcl.github.com/homebrew/
• MacPorts - http://www.macports.org/
Getting Set Up on Windows
• msysgit -http://code.google.com/p/msysgit/
• Cygwin - http://www.cygwin.com/
Getting Set Up on Linux
• apt, etc - you probably know the drill
Gooies!
• Git Tower - http://git-tower.com                                                           M
• Brother Bard’s GitX fork -
Mac                            http://brotherbard.com/blog/2010/03/experimental-gitx-fork/
                                                                                             A
                                                                                             C

•     Tortoise Git - http://code.google.com/p/tortoisegit/                                   W
Mac
                                                                                             I
                                                                                             N
Eclipse Integration
• http://www.eclipse.org/egit/
Reference
• Git - http://git-scm.com/
• ProGit - http://progit.org/book/ - Scott Chacon
• Insider Guide to Github - http://www.pragprog.com/screencasts/
   v-scgithub/insider-guide-to-github - Scott Chacon
Note
• Code may be in backticks: `git <command>`
  • Don’t input the backticks
The Command Line
A Short Sermon
Seven Use Cases
Where Git will Make your Life Easier
Project History
Git will Make your Life Easier
Why Source Control
• For the solo developer?
   •   Protection against mistakes
   •   Freedom
       •   to refactor
       •   to experiment


• For the development team?
   •   All of the above, plus:
   •   Parallel development
   •   Merging different code branches
Simple Commands
• `git init`- Creates an empty Git repository
• .gitignore - tells git to ignore certain files
• `git add` - Adds a file to the stage (“stages a file”)
• `git rm` - Removes from version control
• `git commit` - Commits the staged changes to the (local)
   repository

• `git log`
• `git add -i` Interactive Add
git               git
         or      clone
init


                 git                  86650c185eda50c9f9d58e2fbdf8b7113e5dee54
                         git commit
   changes       add

                 git
                         git commit   6facfd9f34173f4fb024196996e948a87c85eb56
   changes       add

                 git
                         git commit   b02ef5bf190e28ba24eab3ffab6133181cb5b5ef
   changes       add



       ...   ∞
Simple Workflow
.gitignore
• Can be nested deeply
• https://github.com/github/gitignore
  • Use it! Contribute!
Git Log - The Project’s History
• What got committed?
• Commit messages
• Content
• When? Who?
What’s With all the Characters?
86650c185eda50c9f9d58e2fbdf8b7113e5dee54
• SHA1 Hash
• Uniquely identifies a commit
• Secure - very unlikely that someone can tamper with content in a
  repository


       “... to have a probability of a SHA1-hash collision rise to 1/2,
       you need about 10^24 objects ...”
    - Scott Chacon in Pro Git (paraphrased)
Interactive Add - Building Commits
• `git add` simply adds to the stage
• `git commit -a` will commit all changes to tracked files (add and
   commit)

• `git add -i` -- a command line tool to interactively add changes
• Individual commits shouldn’t leave things broken
• Try to commit some useful feature or bug fix all together
Getting Out of Trouble
Git will Make your Life Easier
Advanced Commands
• blame
• checkout
• commit -a
• reset
• stash
• commit --amend
• revert
git blame
• remember: git help blame
• Who broke the build??? etc...
git checkout, commit -a, reset
• remember: git help reset
• `git commit -a` = commit bypassing `git add`
• `git checkout <filename>` = remove all unstaged changes
• `git reset <filename>` = opposite of `git add <filename>`
• `git reset HEAD` = same as above - acts on all changes
• `git reset HEAD^` (also ^^, or ~1, ~42, etc.) = rollback commits
   to working tree

• `git reset --soft` = rollback commit to stage
git stash
• remember: git help stash
• Stash away changes in a safe place
git commit --amend
• Oops! I misspelled something in the commit message
• Oops! I did `git commit -a` and forgot to `git add` a file
• Oops! I just committed a bug
• USE ONLY BEFORE YOU SHARE CHANGES
git revert
• Commits the reverse of a commit
• The previous commit is still there
• != svn revert
Collaboration
Git will Make your Life Easier
Remotes
• remote add
• push
• clone
• pull
• fetch
Strategies
• Star
• Peer to Peer
• Blessed Repository
• Hierarchical
Committer


              Committer                Committer




                           “The
       Committer          Server”                  Committer




                           Committer




Star
• ssh://user@computer:path/to/repo.git
• http                           Peer

• Gitosis
• Gitolite
                     Peer                Peer




Peer to N Peers
Dictator      ... etc. Maintains a “blessed repository”




            Lieutenant                                                Lieutenant




Developer                Developer              Developer                                      Developer




Hierarchical (Linux model)
Topical Development
Git will Make your Life Easier
Branching
• checkout -b
• merging
• Rebasing
• cherry-pick
How To Think About Branching
• Topic Branches
• Mainline
  • What do you want “master” to mean?
• Branching examples
Topic Branches
• Branching is about controlling feature sets
• Make a new branch for a story
• Make a new branch for a bug fix
• Make a new branch to spike something
Team Branching Strategies
• What do you want “master” to mean?
• Keep master deployable?
  • one strategy for web software
• Use “master” as an integration branch?
  • Each developer uses topic branches and integrates to master
  • Make a branch for releases
Branching
                           git checkout -b add_login_activity




master


Mac
      fb4f5d9   c5083fa



                          add_login_activity


                          Mac

                                9aa8827        fe594ce    ccb6f5e
Branching: Merging

                                                git checkout master

                                                                      git merge add_login_activity

master


Mac                                                                     9aa8827        fe594ce       ccb6f5e
      fb4f5d9   c5083fa           3f43fa3




                      add_login_activity


                      Mac

                            9aa8827         fe594ce        ccb6f5e
Branching: Rebasing
 master

 Mac
       fb4f5d9   c5083fa         3f43fa3



                           add_login_activity


        before             Mac
                            9aa8827             fe594ce           ccb6f5e



master

Mac
      fb4f5d9    c5083fa         3f43fa3



                                                  add_login_activit

        after                                     Mac
                                                        9aa8827        fe594ce   ccb6f5e
        `git rebase master`
Branching: Rebasing
• Better than merging
• Don’t use if you’ve pushed your branch to a remote
  • Git will complain about refs
  • Can override with `git push -force`
• Also available on `git pull --rebase`
  • Helpful for avoiding merge commits
  • May cause problems if git can’t automatically merge
     • `git reset HEAD` and start over with normal `git pull`
Cherry-pick

                 git cherry-pick fe594ce


                                                       A new commit
master                                                with the changes
                                                       from fe594ce

Mac
      fb4f5d9   c5083fa           3f43fa3




                      add_login_activity


                      Mac

                            9aa8827         fe594ce            ccb6f5e
Cherry Picking
• Doesn’t add a reference to the old commit
• Only applies the changes
• Future merges should apply cleanly
Release Management
Git will Make your Life Easier
Tagging
• tag
• push --tags
Tagging

      git tag -a -m"Tagging v1.0" v1.0 c5083fa



master


Mac
      fb4f5d9        c5083fa        3f43fa3




• Both -v1.0 and c5083fa will point to c5083fa
• Push this tag with `git push --tags`
• Can be cryptologically signed
Bug Fixing
Git will Make your Life Easier
Bug Fixing
• blame
• bisect
Bisect
  git bisect start                                                            HEAD
  git bisect bad



         fb4f5d9
       Mac
                     c5083fa   3f43fa3   9aa8827   fe594ce   ccb6f5e        2e531cb



  git bisect good fb4f5d9                 HEAD




         fb4f5d9
       Mac
                     c5083fa   3f43fa3   9aa8827   fe594ce   ccb6f5e        2e531cb



  git bisect good
                                                                       Git tells you
                                                                       this was the
  git bisect good
                                                                       first bad
  git bisect bad                                                       commit
                                                             HEAD




         fb4f5d9
       Mac
                     c5083fa   3f43fa3   9aa8827   fe594ce   ccb6f5e        2e531cb
Open Source Code
Git will Make your Life Easier
Github.com
• Search it!
• Forking
• Pull Requests
Thank you!




Git
For the Android Developer
AnDevCon 2011 : Tony Hillerson

More Related Content

What's hot

Why You Should Be Using Git
Why You Should Be Using GitWhy You Should Be Using Git
Why You Should Be Using GitFrancisco Vieira
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubNick Quaranto
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Bosstmacwilliam
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewLuca Milanesio
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with GitRick Umali
 
01 git interview questions &amp; answers
01   git interview questions &amp; answers01   git interview questions &amp; answers
01 git interview questions &amp; answersDeepQuest Software
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAdam Culp
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemAlbanLevy
 

What's hot (19)

Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Why You Should Be Using Git
Why You Should Be Using GitWhy You Should Be Using Git
Why You Should Be Using Git
 
Git advanced
Git advancedGit advanced
Git advanced
 
Git essentials
Git essentialsGit essentials
Git essentials
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Open Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git HubOpen Source Collaboration With Git And Git Hub
Open Source Collaboration With Git And Git Hub
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
 
GitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code ReviewGitBlit plugin for Gerrit Code Review
GitBlit plugin for Gerrit Code Review
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
 
Git Basics Philips
Git Basics PhilipsGit Basics Philips
Git Basics Philips
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
Git'in on Windows
Git'in on WindowsGit'in on Windows
Git'in on Windows
 
01 git interview questions &amp; answers
01   git interview questions &amp; answers01   git interview questions &amp; answers
01 git interview questions &amp; answers
 
Git internals
Git internalsGit internals
Git internals
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Flow
FlowFlow
Flow
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control system
 
Git'in in 15
Git'in in 15Git'in in 15
Git'in in 15
 

Viewers also liked

.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developersmpvanwinkle
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffective
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developersDmitry Guyvoronsky
 
[Easy] How to use Evernote: Beginner's Guide
[Easy]  How to use Evernote: Beginner's Guide[Easy]  How to use Evernote: Beginner's Guide
[Easy] How to use Evernote: Beginner's GuideAna Uy
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKAlexey Kononenko
 
Nem kostregistrering
Nem kostregistreringNem kostregistrering
Nem kostregistreringMichael Momme
 
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are Social
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are SocialSocial Media in a Corporate Context Manchester 2010 - Robin Grant, We Are Social
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are SocialCommunicate Magazine
 
Analyzing film magazines
Analyzing film magazinesAnalyzing film magazines
Analyzing film magazinesHanaEllis
 
Why is going paperless
Why is going paperlessWhy is going paperless
Why is going paperlessLane Severson
 
Tech sessie social enterprise
Tech sessie social enterpriseTech sessie social enterprise
Tech sessie social enterpriseMarijn Somers
 
Internal Data Monitoring in OGD and PSI
Internal Data Monitoring in OGD and PSI Internal Data Monitoring in OGD and PSI
Internal Data Monitoring in OGD and PSI Bernhard Krabina
 
Intro to laterooms
Intro to lateroomsIntro to laterooms
Intro to lateroomsguestc47b6e
 
Cqj5 oo pp
Cqj5 oo ppCqj5 oo pp
Cqj5 oo pp3R4n
 
Metalocaima Brochure
Metalocaima BrochureMetalocaima Brochure
Metalocaima Brochuremetalocaima
 
Car tuning
Car tuningCar tuning
Car tuningDries
 

Viewers also liked (20)

.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Evernote
EvernoteEvernote
Evernote
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
[Easy] How to use Evernote: Beginner's Guide
[Easy]  How to use Evernote: Beginner's Guide[Easy]  How to use Evernote: Beginner's Guide
[Easy] How to use Evernote: Beginner's Guide
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AK
 
Practical Perfect
Practical PerfectPractical Perfect
Practical Perfect
 
Nem kostregistrering
Nem kostregistreringNem kostregistrering
Nem kostregistrering
 
Debates foro humanismo tercero A
Debates foro humanismo tercero ADebates foro humanismo tercero A
Debates foro humanismo tercero A
 
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are Social
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are SocialSocial Media in a Corporate Context Manchester 2010 - Robin Grant, We Are Social
Social Media in a Corporate Context Manchester 2010 - Robin Grant, We Are Social
 
Analyzing film magazines
Analyzing film magazinesAnalyzing film magazines
Analyzing film magazines
 
Why is going paperless
Why is going paperlessWhy is going paperless
Why is going paperless
 
Tech sessie social enterprise
Tech sessie social enterpriseTech sessie social enterprise
Tech sessie social enterprise
 
Internal Data Monitoring in OGD and PSI
Internal Data Monitoring in OGD and PSI Internal Data Monitoring in OGD and PSI
Internal Data Monitoring in OGD and PSI
 
Intro to laterooms
Intro to lateroomsIntro to laterooms
Intro to laterooms
 
Cqj5 oo pp
Cqj5 oo ppCqj5 oo pp
Cqj5 oo pp
 
Metalocaima Brochure
Metalocaima BrochureMetalocaima Brochure
Metalocaima Brochure
 
Roadmap SharePoint
Roadmap SharePointRoadmap SharePoint
Roadmap SharePoint
 
Car tuning
Car tuningCar tuning
Car tuning
 

Similar to Git for Android Developers

Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android DevelopersTony Hillerson
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015mwrather
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Git简介
Git简介Git简介
Git简介clvrobj
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptxgdscuds
 

Similar to Git for Android Developers (20)

Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git简介
Git简介Git简介
Git简介
 
3 Git
3 Git3 Git
3 Git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
simple Git
simple Git simple Git
simple Git
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
 

More from EffectiveUI

Design essentials For Executives
Design essentials For ExecutivesDesign essentials For Executives
Design essentials For ExecutivesEffectiveUI
 
Designing an App: From Idea to Market
Designing an App: From Idea to MarketDesigning an App: From Idea to Market
Designing an App: From Idea to MarketEffectiveUI
 
Flash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldFlash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldEffectiveUI
 
Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11EffectiveUI
 
Flex4 Component Lifecycle
Flex4 Component LifecycleFlex4 Component Lifecycle
Flex4 Component LifecycleEffectiveUI
 
The Art of Interaction
The Art of InteractionThe Art of Interaction
The Art of InteractionEffectiveUI
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for DevelopersEffectiveUI
 
Microsoft Kinect and Molehill
Microsoft Kinect and MolehillMicrosoft Kinect and Molehill
Microsoft Kinect and MolehillEffectiveUI
 
Reasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldReasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldEffectiveUI
 
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...EffectiveUI
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for DevelopersEffectiveUI
 
Your Mom Has an iPad
Your Mom Has an iPadYour Mom Has an iPad
Your Mom Has an iPadEffectiveUI
 
Human-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsHuman-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsEffectiveUI
 
From the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebFrom the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebEffectiveUI
 
Flexerific Visual Effects
Flexerific Visual EffectsFlexerific Visual Effects
Flexerific Visual EffectsEffectiveUI
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentEffectiveUI
 
An Opinionated Introduction to Mate
An Opinionated Introduction to MateAn Opinionated Introduction to Mate
An Opinionated Introduction to MateEffectiveUI
 
Diving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleDiving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleEffectiveUI
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules EngineEffectiveUI
 

More from EffectiveUI (20)

Design essentials For Executives
Design essentials For ExecutivesDesign essentials For Executives
Design essentials For Executives
 
Designing an App: From Idea to Market
Designing an App: From Idea to MarketDesigning an App: From Idea to Market
Designing an App: From Idea to Market
 
Flash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store WorldFlash and Flex in an HTML5 / App Store World
Flash and Flex in an HTML5 / App Store World
 
Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11Design Essentials for Developers 08.31.11
Design Essentials for Developers 08.31.11
 
Flex4 Component Lifecycle
Flex4 Component LifecycleFlex4 Component Lifecycle
Flex4 Component Lifecycle
 
The Art of Interaction
The Art of InteractionThe Art of Interaction
The Art of Interaction
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for Developers
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
Microsoft Kinect and Molehill
Microsoft Kinect and MolehillMicrosoft Kinect and Molehill
Microsoft Kinect and Molehill
 
Reasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store WorldReasons for Flash: Flash Development in an HTML5 and App Store World
Reasons for Flash: Flash Development in an HTML5 and App Store World
 
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
Discombobulation, Fire-Breathing Dragons and Wet Noodles: Creating Productive...
 
Design Essentials for Developers
Design Essentials for DevelopersDesign Essentials for Developers
Design Essentials for Developers
 
Your Mom Has an iPad
Your Mom Has an iPadYour Mom Has an iPad
Your Mom Has an iPad
 
Human-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital WorldsHuman-Centered Design and the Intersection of the Physical and Digital Worlds
Human-Centered Design and the Intersection of the Physical and Digital Worlds
 
From the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible WebFrom the Trenches: Building the Accessible Web
From the Trenches: Building the Accessible Web
 
Flexerific Visual Effects
Flexerific Visual EffectsFlexerific Visual Effects
Flexerific Visual Effects
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
An Opinionated Introduction to Mate
An Opinionated Introduction to MateAn Opinionated Introduction to Mate
An Opinionated Introduction to Mate
 
Diving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life CycleDiving Deep with the Flex Component Life Cycle
Diving Deep with the Flex Component Life Cycle
 
Flex 360 Rules Engine
Flex 360 Rules EngineFlex 360 Rules Engine
Flex 360 Rules Engine
 

Recently uploaded

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Git for Android Developers

  • 1. Git For the Android Developer AnDevCon 2011 : Tony Hillerson #AnDevCon #effectiveui http://www.slideshare.net/thillerson/scm-for-android-developers-using-git
  • 2. About Me • Worked with Android and Git for a few years now • O’Reilly Screencaster: Developing Android Applications • http://training.oreilly.com/androidapps/ • http://training.oreilly.com/androidapps2/ • Tech Reviewer:
  • 4. What’s a Git? A completely ignorant, childish person with no manners. - http://urbandictionary.com Linus Torvalds http://en.wikipedia.org/wiki/Linus_Torvalds
  • 5. What’s a Git? Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. - http://git-scm.com
  • 6. Getting Set Up on Mac • Homebrew - http://mxcl.github.com/homebrew/ • MacPorts - http://www.macports.org/
  • 7. Getting Set Up on Windows • msysgit -http://code.google.com/p/msysgit/ • Cygwin - http://www.cygwin.com/
  • 8. Getting Set Up on Linux • apt, etc - you probably know the drill
  • 9. Gooies! • Git Tower - http://git-tower.com M • Brother Bard’s GitX fork - Mac http://brotherbard.com/blog/2010/03/experimental-gitx-fork/ A C • Tortoise Git - http://code.google.com/p/tortoisegit/ W Mac I N
  • 11. Reference • Git - http://git-scm.com/ • ProGit - http://progit.org/book/ - Scott Chacon • Insider Guide to Github - http://www.pragprog.com/screencasts/ v-scgithub/insider-guide-to-github - Scott Chacon
  • 12. Note • Code may be in backticks: `git <command>` • Don’t input the backticks
  • 13. The Command Line A Short Sermon
  • 14. Seven Use Cases Where Git will Make your Life Easier
  • 15. Project History Git will Make your Life Easier
  • 16. Why Source Control • For the solo developer? • Protection against mistakes • Freedom • to refactor • to experiment • For the development team? • All of the above, plus: • Parallel development • Merging different code branches
  • 17. Simple Commands • `git init`- Creates an empty Git repository • .gitignore - tells git to ignore certain files • `git add` - Adds a file to the stage (“stages a file”) • `git rm` - Removes from version control • `git commit` - Commits the staged changes to the (local) repository • `git log` • `git add -i` Interactive Add
  • 18. git git or clone init git 86650c185eda50c9f9d58e2fbdf8b7113e5dee54 git commit changes add git git commit 6facfd9f34173f4fb024196996e948a87c85eb56 changes add git git commit b02ef5bf190e28ba24eab3ffab6133181cb5b5ef changes add ... ∞ Simple Workflow
  • 19. .gitignore • Can be nested deeply • https://github.com/github/gitignore • Use it! Contribute!
  • 20. Git Log - The Project’s History • What got committed? • Commit messages • Content • When? Who?
  • 21. What’s With all the Characters? 86650c185eda50c9f9d58e2fbdf8b7113e5dee54 • SHA1 Hash • Uniquely identifies a commit • Secure - very unlikely that someone can tamper with content in a repository “... to have a probability of a SHA1-hash collision rise to 1/2, you need about 10^24 objects ...” - Scott Chacon in Pro Git (paraphrased)
  • 22. Interactive Add - Building Commits • `git add` simply adds to the stage • `git commit -a` will commit all changes to tracked files (add and commit) • `git add -i` -- a command line tool to interactively add changes • Individual commits shouldn’t leave things broken • Try to commit some useful feature or bug fix all together
  • 23. Getting Out of Trouble Git will Make your Life Easier
  • 24. Advanced Commands • blame • checkout • commit -a • reset • stash • commit --amend • revert
  • 25. git blame • remember: git help blame • Who broke the build??? etc...
  • 26. git checkout, commit -a, reset • remember: git help reset • `git commit -a` = commit bypassing `git add` • `git checkout <filename>` = remove all unstaged changes • `git reset <filename>` = opposite of `git add <filename>` • `git reset HEAD` = same as above - acts on all changes • `git reset HEAD^` (also ^^, or ~1, ~42, etc.) = rollback commits to working tree • `git reset --soft` = rollback commit to stage
  • 27. git stash • remember: git help stash • Stash away changes in a safe place
  • 28. git commit --amend • Oops! I misspelled something in the commit message • Oops! I did `git commit -a` and forgot to `git add` a file • Oops! I just committed a bug • USE ONLY BEFORE YOU SHARE CHANGES
  • 29. git revert • Commits the reverse of a commit • The previous commit is still there • != svn revert
  • 30. Collaboration Git will Make your Life Easier
  • 31. Remotes • remote add • push • clone • pull • fetch
  • 32. Strategies • Star • Peer to Peer • Blessed Repository • Hierarchical
  • 33. Committer Committer Committer “The Committer Server” Committer Committer Star
  • 34. • ssh://user@computer:path/to/repo.git • http Peer • Gitosis • Gitolite Peer Peer Peer to N Peers
  • 35. Dictator ... etc. Maintains a “blessed repository” Lieutenant Lieutenant Developer Developer Developer Developer Hierarchical (Linux model)
  • 36. Topical Development Git will Make your Life Easier
  • 37. Branching • checkout -b • merging • Rebasing • cherry-pick
  • 38. How To Think About Branching • Topic Branches • Mainline • What do you want “master” to mean? • Branching examples
  • 39. Topic Branches • Branching is about controlling feature sets • Make a new branch for a story • Make a new branch for a bug fix • Make a new branch to spike something
  • 40. Team Branching Strategies • What do you want “master” to mean? • Keep master deployable? • one strategy for web software • Use “master” as an integration branch? • Each developer uses topic branches and integrates to master • Make a branch for releases
  • 41. Branching git checkout -b add_login_activity master Mac fb4f5d9 c5083fa add_login_activity Mac 9aa8827 fe594ce ccb6f5e
  • 42. Branching: Merging git checkout master git merge add_login_activity master Mac 9aa8827 fe594ce ccb6f5e fb4f5d9 c5083fa 3f43fa3 add_login_activity Mac 9aa8827 fe594ce ccb6f5e
  • 43. Branching: Rebasing master Mac fb4f5d9 c5083fa 3f43fa3 add_login_activity before Mac 9aa8827 fe594ce ccb6f5e master Mac fb4f5d9 c5083fa 3f43fa3 add_login_activit after Mac 9aa8827 fe594ce ccb6f5e `git rebase master`
  • 44. Branching: Rebasing • Better than merging • Don’t use if you’ve pushed your branch to a remote • Git will complain about refs • Can override with `git push -force` • Also available on `git pull --rebase` • Helpful for avoiding merge commits • May cause problems if git can’t automatically merge • `git reset HEAD` and start over with normal `git pull`
  • 45. Cherry-pick git cherry-pick fe594ce A new commit master with the changes from fe594ce Mac fb4f5d9 c5083fa 3f43fa3 add_login_activity Mac 9aa8827 fe594ce ccb6f5e
  • 46. Cherry Picking • Doesn’t add a reference to the old commit • Only applies the changes • Future merges should apply cleanly
  • 47. Release Management Git will Make your Life Easier
  • 49. Tagging git tag -a -m"Tagging v1.0" v1.0 c5083fa master Mac fb4f5d9 c5083fa 3f43fa3 • Both -v1.0 and c5083fa will point to c5083fa • Push this tag with `git push --tags` • Can be cryptologically signed
  • 50. Bug Fixing Git will Make your Life Easier
  • 52. Bisect git bisect start HEAD git bisect bad fb4f5d9 Mac c5083fa 3f43fa3 9aa8827 fe594ce ccb6f5e 2e531cb git bisect good fb4f5d9 HEAD fb4f5d9 Mac c5083fa 3f43fa3 9aa8827 fe594ce ccb6f5e 2e531cb git bisect good Git tells you this was the git bisect good first bad git bisect bad commit HEAD fb4f5d9 Mac c5083fa 3f43fa3 9aa8827 fe594ce ccb6f5e 2e531cb
  • 53. Open Source Code Git will Make your Life Easier
  • 54. Github.com • Search it! • Forking • Pull Requests
  • 55. Thank you! Git For the Android Developer AnDevCon 2011 : Tony Hillerson