SlideShare uma empresa Scribd logo
1 de 67
Baixar para ler offline
Git
For the Android Developer
Tony Hillerson, AnDevCon Fall 2011
#AnDevCon #effectiveui @thillerson
http://www.slideshare.net/thillerson/git-for-android-developers
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
Conference App
➡ Get it,   rate stuff
Diving Right In
Learning by Doing
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
Git Log - The Project’s History
➡ What   got committed?
➡ Commit    messages
➡ Content

➡ When? Who?
Remotes
➡ remote   add
➡ clone

➡ fetch

➡ pull

➡ push
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
Recap of Simple Commands
➡ git init -   Creates an empty Git repository
➡ 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 -    A view of the history
➡ git tag -    Names a commit
➡ .gitignore    - tells git to ignore certain files
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
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/
Getting Set Up on Linux
➡ apt,   etc - you probably know the drill
Gooies!
➡ Git Tower       - http://git-tower.com                            M
➡ Brother
Mac


                Bard’s GitX fork -                                  A
      http://brotherbard.com/blog/2010/03/experimental-gitx-fork/   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
The Command Line
A Short Sermon
The Guts of Git
The Little Bits that Make Git Different
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)
In Git There Are Only...
➡ Blobs

➡ Trees

➡ Commits
Blobs
➡ The   contents of your files are stored as binary files
  in .git/objects
➡ Git is   efficient. It only stores the same content once.
➡ Identified   by a SHA-1
➡ Show     blob contents with e.g. git show c7fb9f5
Trees
➡ Trees   give structure to blobs
➡ Trees   are also stored in .git/objects
➡ Identified   by SHA-1
➡ View    a tree with ls-tree, e.g. `git ls-tree HEAD`
Commits
➡ Identified   by a SHA-1
➡ Points   to one tree
➡ Has   a required message
➡ May   have one (or more) parent commit(s)
➡ Show   the reachable commits from a commit: git rev-list
  HEAD
Refs
➡ Point   to commits
➡ .git/refs/heads   - the latest commits in local branches
➡ HEAD    - the latest commit on the current branch
Blobs Are Content



               b84ed8ed


                          e8d5cf6
          579a3b1
Trees Give Structure
9899d2c
           b84ed8ed   foo.txt

           579a3b1    bar.txt

           e8d5cf6    baz.html
                                 trees can point
          3ffb35b     /images     to other trees
Commits Point to Trees

        d414c3e                    9899d2c
     “Updated the main activity”

                                              b84ed8ed
                                                         foo.txt

                                               579a3b1
                                                         bar.txt

                                               e8d5cf6
                                                         baz.html

                                             3ffb35b     /images
Commits have Parents

                 d414c3e
                 “Updated the main activity”




                 090c953
                      “Fixed bug #42”




                 4493671
                   “Added RoboGuice”




                 c1d1f60
                      “Initial commit”
Refs Point to Commits


           HEAD         d414c3e
                        “Updated the main activity”




                        090c953
                             “Fixed bug #42”




                        4493671
                          “Added RoboGuice”




                        c1d1f60
                             “Initial commit”
And That’s All You
Need To Know About
        Git
And That’s All You
Need To Know About
        Git
       (Mostly)
Sweet Moves with Git
Sweet, Sweet Moves
Interactive Add
Building Semantic Commits
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
Amending A Commit
Fix the Last Commit
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
More Like Git Reverse
git revert
➡ Commits    the reverse of a commit
➡ The   previous commit is still there
➡ !=   svn revert
Git Stash
Like a Little Repo In Your Repo
git stash
➡ remember:    git help stash
➡ Stash   away changes in a safe place
Branching
Hitting Save Before You Fight the Level Boss
Branching
➡ checkout -b

➡ merging

➡ rebasing
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_activity

        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
➡ Can   override with `git push -force`
Git Pull --rebase
➡ Also   available: `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
I’ll Take One Of Those... And One Of Those...
Cherry-pick

 git cherry-pick fe594ce
                                                              A new commit with
master                                                         the changes from
                                                                    fe594ce

Mac
      fb4f5d9   c5083fa                   3f43fa3




                          add_login_activity


                          Mac

                                9aa8827             fe594ce              ccb6f5e
Interactive Rebase
Rewrite History
Interactive Rebase - Fixing History
➡ git rebase   -i [commit]
➡A   list of all commits in the current order
➡ Reorder

➡ Fix   a certain commit
➡ Squash    commits together
➡ Delete   commits
➡ DON’T USE     AFTER YOU’VE PUSHED
Whoops!
Lots Of Ways To Fix It
git checkout
➡ `git   checkout [filename]` = remove all unstaged changes
git reset
➡ `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
➡ All examples    of “mixed” reset
git reset soft
➡ git reset --soft   [commit]
➡ Moves   HEAD to commit
➡ Puts   the “popped” contents on the index
git reset mixed (default)
➡ git reset [commit]

➡ Moves   HEAD to commit
➡ Puts   the “popped” contents on the index
➡ Moves   the index to the working tree as changes
git reset hard
➡ git reset --hard   [commit]
➡ Moves   HEAD to commit
➡ Puts   the “popped” contents on the index
➡ Moves   the index to the working tree as changes
➡ Makes    the working tree look like the index
➡ DESTRUCTIVE
git reset use cases
➡ Back    that last commit up (git reset HEAD^)
➡ Don’t   forget `commit --amend`
➡ Oops,    didn’t mean to commit that file
➡I   meant that commit to be on a branch!
The Take Home
➡ SCM      Is Important
➡ No matter     what kind of developer you are
➡ Git is   fundamentally different from the others
➡ It’s not   a database of patches
➡ It’s a history   of filesystem snapshots
➡ It   gives you freedom to innovate, make mistakes, and
  collaborate.
Thank you!
                                     #AnDevCon
                                     #effectiveui
                                     @thillerson
                                     http://github.com/thillerson
                                     http://slideshare.com/thillerson




Half Off My Git Course                                                  These Slides

Git   For the Android Developer • Tony Hillerson • AnDevCon Fall 2011

Mais conteúdo relacionado

Mais procurados

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
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015mwrather
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginningJames Aylett
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Front Page of Hacker News with GitLab Pages
Front Page of Hacker News with GitLab PagesFront Page of Hacker News with GitLab Pages
Front Page of Hacker News with GitLab PagesWill Hall
 
Git Introduction
Git IntroductionGit Introduction
Git IntroductionGareth Hall
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewLuca Milanesio
 
Git censored.key
Git censored.keyGit censored.key
Git censored.keymkramer2
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaBo-Yi Wu
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for BeginnersRick Umali
 

Mais procurados (19)

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 and Github
Git and GithubGit and Github
Git and Github
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
Git Basics Philips
Git Basics PhilipsGit Basics Philips
Git Basics Philips
 
Git
GitGit
Git
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Did you git yet?
Did you git yet?Did you git yet?
Did you git yet?
 
Front Page of Hacker News with GitLab Pages
Front Page of Hacker News with GitLab PagesFront Page of Hacker News with GitLab Pages
Front Page of Hacker News with GitLab Pages
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
 
Git censored.key
Git censored.keyGit censored.key
Git censored.key
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for Beginners
 

Destaque

Oleksandr Tolstykh "Quality. Android quality"
Oleksandr Tolstykh "Quality. Android quality"Oleksandr Tolstykh "Quality. Android quality"
Oleksandr Tolstykh "Quality. Android quality"IT Event
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffective
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developersmpvanwinkle
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android DevelopersTack Mobile
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAdam Culp
 
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
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffectiveUI
 
Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Saâd Zerhouni
 

Destaque (12)

Oleksandr Tolstykh "Quality. Android quality"
Oleksandr Tolstykh "Quality. Android quality"Oleksandr Tolstykh "Quality. Android quality"
Oleksandr Tolstykh "Quality. Android quality"
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Evernote
EvernoteEvernote
Evernote
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
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
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C#
 

Semelhante a Git For The Android Developer

Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopAll Things Open
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Codemotion
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - WorkflowTahsin Abrar
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)Carlos Duarte do Nascimento
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshellalignan
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for GitJan Krag
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get GitSusan Tan
 

Semelhante a Git For The Android Developer (20)

How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
 
Github integration-kostyasha
Github integration-kostyashaGithub integration-kostyasha
Github integration-kostyasha
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Jedi Mind Tricks in Git
Jedi Mind Tricks in GitJedi Mind Tricks in Git
Jedi Mind Tricks in Git
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
Git
GitGit
Git
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Git
GitGit
Git
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
 
Loading...git
Loading...gitLoading...git
Loading...git
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Gittalk
GittalkGittalk
Gittalk
 

Mais de Effective

User Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsUser Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsEffective
 
Death of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefDeath of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefEffective
 
UX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXUX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXEffective
 
Give Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyGive Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyEffective
 
Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Effective
 
Introduction to UX
Introduction to UXIntroduction to UX
Introduction to UXEffective
 
2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker PresentationEffective
 
Water For People UX Awards Submission
Water For People UX Awards SubmissionWater For People UX Awards Submission
Water For People UX Awards SubmissionEffective
 
Getting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeGetting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeEffective
 
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughScottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughEffective
 
A Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingA Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingEffective
 
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Effective
 
Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Effective
 
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Effective
 
Liferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationLiferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationEffective
 
The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0Effective
 
Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Effective
 
Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Effective
 
SXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalSXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalEffective
 
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...Effective
 

Mais de Effective (20)

User Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your NeedsUser Testing: Adapt to Fit Your Needs
User Testing: Adapt to Fit Your Needs
 
Death of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of GriefDeath of a Design: 5 Stages of Grief
Death of a Design: 5 Stages of Grief
 
UX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UXUX Design Process 101: Where to start with UX
UX Design Process 101: Where to start with UX
 
Give Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable TechnologyGive Them What They Want: Discovering Customer Need with Wearable Technology
Give Them What They Want: Discovering Customer Need with Wearable Technology
 
Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)Common Innovation Myths (World Usability Day)
Common Innovation Myths (World Usability Day)
 
Introduction to UX
Introduction to UXIntroduction to UX
Introduction to UX
 
2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation2016 SXSW Measures for Justice Panel Picker Presentation
2016 SXSW Measures for Justice Panel Picker Presentation
 
Water For People UX Awards Submission
Water For People UX Awards SubmissionWater For People UX Awards Submission
Water For People UX Awards Submission
 
Getting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into PracticeGetting into the Game: How EA Put User Research into Practice
Getting into the Game: How EA Put User Research into Practice
 
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t EnoughScottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
Scottrade and Understanding the Customer Journey: When Segmentation Isn’t Enough
 
A Blended Space for Heritage Storytelling
A Blended Space for Heritage StorytellingA Blended Space for Heritage Storytelling
A Blended Space for Heritage Storytelling
 
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
Using Behavioral Modeling to Engage Customers Throughout the Decision-Making ...
 
Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?Mobile Website Design: Responsive, Adaptive or Both?
Mobile Website Design: Responsive, Adaptive or Both?
 
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
Integrated Thinking: The Answer to Enterprise IT’s Perpetual Struggle - Forre...
 
Liferay and Water For People: From Data to Information
Liferay and Water For People: From Data to InformationLiferay and Water For People: From Data to Information
Liferay and Water For People: From Data to Information
 
The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0The Rules of UX - Enterprise 2.0
The Rules of UX - Enterprise 2.0
 
Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013Making Mobile Meaningful NY 2013
Making Mobile Meaningful NY 2013
 
Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013Experience Driven Development - Future Insights Live 2013
Experience Driven Development - Future Insights Live 2013
 
SXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobalSXSW 2013 Daily Recap - Sunday GoodxGlobal
SXSW 2013 Daily Recap - Sunday GoodxGlobal
 
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
The Human Interface: Making UX An Integral Part of Your Technology Buying Dec...
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

Git For The Android Developer

  • 1. Git For the Android Developer Tony Hillerson, AnDevCon Fall 2011 #AnDevCon #effectiveui @thillerson http://www.slideshare.net/thillerson/git-for-android-developers
  • 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
  • 3. Conference App ➡ Get it, rate stuff
  • 5. 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
  • 6. .gitignore ➡ Can be nested deeply ➡ https://github.com/github/gitignore
  • 7. Git Log - The Project’s History ➡ What got committed? ➡ Commit messages ➡ Content ➡ When? Who?
  • 8. Remotes ➡ remote add ➡ clone ➡ fetch ➡ pull ➡ push
  • 9. 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
  • 10. Recap of Simple Commands ➡ git init - Creates an empty Git repository ➡ 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 - A view of the history ➡ git tag - Names a commit ➡ .gitignore - tells git to ignore certain files
  • 11. 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
  • 13. What’s a Git? A completely ignorant, childish person with no manners. - http://urbandictionary.com Linus Torvalds http://en.wikipedia.org/wiki/Linus_Torvalds
  • 14. 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
  • 15. Getting Set Up on Mac ➡ Homebrew - http://mxcl.github.com/homebrew/ ➡ MacPorts - http://www.macports.org/
  • 16. Getting Set Up on Windows ➡ msysgit -http://code.google.com/p/msysgit/
  • 17. Getting Set Up on Linux ➡ apt, etc - you probably know the drill
  • 18. Gooies! ➡ Git Tower - http://git-tower.com M ➡ Brother Mac Bard’s GitX fork - A http://brotherbard.com/blog/2010/03/experimental-gitx-fork/ C ➡ Tortoise Git - http://code.google.com/p/tortoisegit/ W Mac I N
  • 20. 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
  • 21. The Command Line A Short Sermon
  • 22. The Guts of Git The Little Bits that Make Git Different
  • 23. 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)
  • 24. In Git There Are Only... ➡ Blobs ➡ Trees ➡ Commits
  • 25. Blobs ➡ The contents of your files are stored as binary files in .git/objects ➡ Git is efficient. It only stores the same content once. ➡ Identified by a SHA-1 ➡ Show blob contents with e.g. git show c7fb9f5
  • 26. Trees ➡ Trees give structure to blobs ➡ Trees are also stored in .git/objects ➡ Identified by SHA-1 ➡ View a tree with ls-tree, e.g. `git ls-tree HEAD`
  • 27. Commits ➡ Identified by a SHA-1 ➡ Points to one tree ➡ Has a required message ➡ May have one (or more) parent commit(s) ➡ Show the reachable commits from a commit: git rev-list HEAD
  • 28. Refs ➡ Point to commits ➡ .git/refs/heads - the latest commits in local branches ➡ HEAD - the latest commit on the current branch
  • 29. Blobs Are Content b84ed8ed e8d5cf6 579a3b1
  • 30. Trees Give Structure 9899d2c b84ed8ed foo.txt 579a3b1 bar.txt e8d5cf6 baz.html trees can point 3ffb35b /images to other trees
  • 31. Commits Point to Trees d414c3e 9899d2c “Updated the main activity” b84ed8ed foo.txt 579a3b1 bar.txt e8d5cf6 baz.html 3ffb35b /images
  • 32. Commits have Parents d414c3e “Updated the main activity” 090c953 “Fixed bug #42” 4493671 “Added RoboGuice” c1d1f60 “Initial commit”
  • 33. Refs Point to Commits HEAD d414c3e “Updated the main activity” 090c953 “Fixed bug #42” 4493671 “Added RoboGuice” c1d1f60 “Initial commit”
  • 34. And That’s All You Need To Know About Git
  • 35. And That’s All You Need To Know About Git (Mostly)
  • 36. Sweet Moves with Git Sweet, Sweet Moves
  • 38. 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
  • 39. Amending A Commit Fix the Last Commit
  • 40. 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
  • 41. Git Revert More Like Git Reverse
  • 42. git revert ➡ Commits the reverse of a commit ➡ The previous commit is still there ➡ != svn revert
  • 43. Git Stash Like a Little Repo In Your Repo
  • 44. git stash ➡ remember: git help stash ➡ Stash away changes in a safe place
  • 45. Branching Hitting Save Before You Fight the Level Boss
  • 46. Branching ➡ checkout -b ➡ merging ➡ rebasing
  • 47. How To Think About Branching ➡ Topic Branches ➡ Mainline ➡ What do you want “master” to mean? ➡ Branching examples
  • 48. 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
  • 49. 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
  • 50. Branching git checkout -b add_login_activity master Mac fb4f5d9 c5083fa add_login_activity Mac 9aa8827 fe594ce ccb6f5e
  • 51. 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
  • 52. Branching: Rebasing master Mac fb4f5d9 c5083fa 3f43fa3 add_login_activity before Mac 9aa8827 fe594ce ccb6f5e master Mac fb4f5d9 c5083fa 3f43fa3 add_login_activity after Mac 9aa8827 fe594ce ccb6f5e `git rebase master`
  • 53. Branching: Rebasing ➡ Better than merging ➡ Don’t use if you’ve pushed your branch to a remote ➡ Can override with `git push -force`
  • 54. Git Pull --rebase ➡ Also available: `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`
  • 55. Cherry Pick I’ll Take One Of Those... And One Of Those...
  • 56. Cherry-pick git cherry-pick fe594ce A new commit with master the changes from fe594ce Mac fb4f5d9 c5083fa 3f43fa3 add_login_activity Mac 9aa8827 fe594ce ccb6f5e
  • 58. Interactive Rebase - Fixing History ➡ git rebase -i [commit] ➡A list of all commits in the current order ➡ Reorder ➡ Fix a certain commit ➡ Squash commits together ➡ Delete commits ➡ DON’T USE AFTER YOU’VE PUSHED
  • 59. Whoops! Lots Of Ways To Fix It
  • 60. git checkout ➡ `git checkout [filename]` = remove all unstaged changes
  • 61. git reset ➡ `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 ➡ All examples of “mixed” reset
  • 62. git reset soft ➡ git reset --soft [commit] ➡ Moves HEAD to commit ➡ Puts the “popped” contents on the index
  • 63. git reset mixed (default) ➡ git reset [commit] ➡ Moves HEAD to commit ➡ Puts the “popped” contents on the index ➡ Moves the index to the working tree as changes
  • 64. git reset hard ➡ git reset --hard [commit] ➡ Moves HEAD to commit ➡ Puts the “popped” contents on the index ➡ Moves the index to the working tree as changes ➡ Makes the working tree look like the index ➡ DESTRUCTIVE
  • 65. git reset use cases ➡ Back that last commit up (git reset HEAD^) ➡ Don’t forget `commit --amend` ➡ Oops, didn’t mean to commit that file ➡I meant that commit to be on a branch!
  • 66. The Take Home ➡ SCM Is Important ➡ No matter what kind of developer you are ➡ Git is fundamentally different from the others ➡ It’s not a database of patches ➡ It’s a history of filesystem snapshots ➡ It gives you freedom to innovate, make mistakes, and collaborate.
  • 67. Thank you! #AnDevCon #effectiveui @thillerson http://github.com/thillerson http://slideshare.com/thillerson Half Off My Git Course These Slides Git For the Android Developer • Tony Hillerson • AnDevCon Fall 2011