• Like
  • Save
Git
Upcoming SlideShare
Loading in...5
×
 

Git

on

  • 1,850 views

 

Statistics

Views

Total Views
1,850
Views on SlideShare
1,844
Embed Views
6

Actions

Likes
5
Downloads
15
Comments
0

2 Embeds 6

http://coderwall.com 5
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

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

    Git Git Presentation Transcript

    • git Handlino http://handlino.com/
    • basics Handlino http://handlino.com/
    • git ... • • • Everything is local • : commit / tag / tree / blob • Handlino http://handlino.com/
    • git clone git://host/project.git git clone ssh://host/project git clone /path/to/project # project/ # project/.git/ Handlino http://handlino.com/
    • cd project git log git log --graph git branch -a git blame src.rb gitx # http://gitx.frim.nl gitk # built-in Handlino http://handlino.com/
    • Handlino http://handlino.com/
    • Handlino http://handlino.com/
    • “commit” sha1 digest commit 9d38288f99caa27b7368d8a2b26c3b545f0eb37b Author: tka lu <tka@mail2000.com.tw> Date: Wed Dec 23 08:51:59 2009 +0800 fix label_render in form_interface_helper Handlino http://handlino.com/
    • more “git log” git log <from>...<to> # <to> is default to HEAD git log 22f9d..5d113 git log 22f9d..5d113 --name-only git log 22f9d..5d113 -u git log HEAD~10.. git log --pretty=oneline --abbrev-commit --decorate HEAD~10.. Handlino http://handlino.com/
    • more “git log” git config alias.lol 'log --pretty=oneline --abbrev-commit --graph --decorate' git lol '@{10 days ago}..' git lol '@{1 week ago}..' git lol '@{1 week ago}..' git lol '@{2009-12-20 01:01:01}..' Handlino http://handlino.com/
    • vim src1.pl src2.pl git status # git diff # git add src1.pl src2.pl # staging area git diff --cached # staging area git commit -m "An *awesome* work" # staging area Handlino http://handlino.com/
    • Staging area git add git commit Handlino http://handlino.com/
    • git pull # ← git push # ! git pull github master git push github bug-31337 Handlino http://handlino.com/
    • mkdir NewProject cd NewProject git init echo "New Project" > README git add README git ci -m "first commit!" Handlino http://handlino.com/
    • git reset HEAD^ # git reset <sha1> # vim src1.pl git add src1.pl src2.pl git commit -m "An *awesome* work" Handlino http://handlino.com/
    • git log git status git branch git commit git checkout git merge git add git tag git diff Handlino http://handlino.com/
    • branch / merge Handlino http://handlino.com/
    • branch git branch git branch -a git branch <new branch name> git checkout <branch name> git checkout -b <new branch name> Handlino http://handlino.com/
    • merge git checkout <branch name> git merge <other branch name> git checkout job-a git merge job-b # job-a <-job-b Handlino http://handlino.com/
    • What is a “branch” ? c866 master Handlino http://handlino.com/
    • What is a “branch” ? git commit c866 a957 master Handlino http://handlino.com/
    • What is a “branch” ? git commit c866 a957 8ecd master Handlino http://handlino.com/
    • What is a “branch” ? git commit c866 a957 8ecd 316f master Handlino http://handlino.com/
    • What is a “branch” ? git commit c866 a957 8ecd 316f 1aee master Handlino http://handlino.com/
    • What is a “branch” ? git commit c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
    • What is a “branch” ? c866 a957 master git commit Handlino http://handlino.com/
    • What is a “branch” ? bug-37 git checkout -b bug 37 git commit ce33 c866 a957 master git commit Handlino http://handlino.com/
    • What is a “branch” ? bug-37 git commit ce33 1aee c3f2 c866 a957 8ecd 316f 1aee master git commit Handlino http://handlino.com/
    • What is a “branch” ? ce33 1aee c3f2 c866 a957 8ecd 316f 1aee 1aee git merge bug-37 master Handlino http://handlino.com/
    • What is a “branch” ? “merge” ce33 1aee c3f2 commit c866 a957 8ecd 316f 1aee 1aee git merge bug-37 master Handlino http://handlino.com/
    • Current branch c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
    • Current branch HEAD c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
    • Current branch commit HEAD c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
    • Current branch bug-37 HEAD ce33 1aee c3f2 c866 a957 8ecd 316f 1aee master Handlino http://handlino.com/
    • Current branch bug-37 ce33 1aee c3f2 c866 a957 8ecd 316f 1aee HEAD git checkout bug-37 master Handlino http://handlino.com/
    • workflow Handlino http://handlino.com/
    • Topic Branch Handlino http://handlino.com/
    • Topic Branch git checkout -b js-refactor vim foo.js bar.js git commit -a -m "delete weird codes" vim foo.js bar.js git commit -a -m "add good code." git checkout master git merge js-refactor git pull git push Handlino http://handlino.com/
    • branch from master, merge to master. css-refactor master bug-3414 Handlino http://handlino.com/
    • Branch rc - deploy to staging release - deploy to production master - dev trunk (others) - dev topics Handlino http://handlino.com/
    • topic → master → rc → release (master) git checkout -b awesome-feature # hack, hack, hack git checkout master git merge awesome-feature git co rc git merge master # deploy. test staging git co release git merge rc # deploy to production Handlino http://handlino.com/
    • stable master (master) git checkout -b awesome-feature # hack, hack, hack (master) git checkout -b bug-fix-123 # hack, hack, hack git checkout test (test) git merge awesome-feature (test) git merge bug-fix-123 # run QA tests (test) git checkout master (master) git merge test # deploy master to production Handlino http://handlino.com/
    • • git help <command> • gitready.com • gitcasts.com Handlino http://handlino.com/