Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git Good with Git! — Intermediate
Search
erynofwales
August 06, 2012
Technology
1
220
Git Good with Git! — Intermediate
Intermediate Git workshop.
erynofwales
August 06, 2012
Tweet
Share
Other Decks in Technology
See All in Technology
Is Go A Good Language to Build Compilers?
kennethanceyer
0
110
日経電子版のStoreKit2フルリニューアル
shimastripe
2
170
LLMの気持ちになってRAGのことを考えてみよう
john_smith
0
160
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
290
JAWS UG 青森(弘前)クラウド・AWS入門
hiragahh
0
140
LINEヤフーにおけるPrerender技術の導入とその効果
narirou
2
2.8k
複雑なState管理からの脱却
sansantech
PRO
1
180
Storybook との上手な向き合い方を考える
re_taro
5
3.8k
心が動くエンジニアリング ── 私が夢中になる理由
16bitidol
0
130
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
30
14k
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
140
SSMRunbook作成の勘所_20241120
koichiotomo
3
190
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1366
200k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Designing Experiences People Love
moore
138
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
What's new in Ruby 2.0
geeforr
343
31k
Become a Pro
speakerdeck
PRO
25
5k
Making Projects Easy
brettharned
115
5.9k
For a Future-Friendly Web
brad_frost
175
9.4k
Navigating Team Friction
lara
183
14k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Transcript
Git Good with Git! – Intermediate Eryn Wells (@erynofwales) 1
Tuesday, 2012 August 7
Do you have Git installed? http://git-scm.com 2 Tuesday, 2012 August
7
Clone this repo git clone https://github.com/erynofwales/talks- intermediate-git-demo.git 3 Tuesday, 2012
August 7
Ask questions! @erynofwales
[email protected]
4 Tuesday, 2012 August 7
Review 5 Tuesday, 2012 August 7
What is Git? 6 Tuesday, 2012 August 7
Distributed Content Tracking 7 Tuesday, 2012 August 7
Distributed Content Tracking 8 Tuesday, 2012 August 7
You 9 Tuesday, 2012 August 7
You 9 Tuesday, 2012 August 7
Distributed Content Tracking 10 Tuesday, 2012 August 7
Anatomy of a Git Repo 11 Tuesday, 2012 August 7
1. Working Tree 12 Tuesday, 2012 August 7
2. Stage (a.k.a. the index) 13 Tuesday, 2012 August 7
3. Repository 14 Tuesday, 2012 August 7
Three-Stage Workflow 15 Tuesday, 2012 August 7
1. Make some changes vim emacs TextMate git rm git
mv 16 Tuesday, 2012 August 7
2. Stage your changes git diff git diff --cached git
add 17 Tuesday, 2012 August 7
3. Commit your changes git commit 18 Tuesday, 2012 August
7
Getting Status git diff git status 19 Tuesday, 2012 August
7
Git <3 Graphs 20 Tuesday, 2012 August 7
JavaScript Ruby Python Shell Java PHP C C++ Perl Objective-C
0% 5% 10% 15% 20% 3% 4% 4% 7% 7% 8% 8% 9% 14% 20% Top Languages (C) 2012 GITHUB, FETCHED 2012-08-04 21 Tuesday, 2012 August 7
JavaScript Ruby Python Shell Java PHP C C++ Perl Objective-C
0% 5% 10% 15% 20% 3% 4% 4% 7% 7% 8% 8% 9% 14% 20% Top Languages (C) 2012 GITHUB, FETCHED 2012-08-04 21 Tuesday, 2012 August 7
Directed Acyclic Graphs 22 Tuesday, 2012 August 7
Directed Acyclic Graphs 23 Tuesday, 2012 August 7
A B C E D F G 24 Tuesday, 2012
August 7
Directed Acyclic Graphs 25 Tuesday, 2012 August 7
A B C E D F G 26 Tuesday, 2012
August 7
Directed Acyclic Graphs 27 Tuesday, 2012 August 7
A B C E D F 28 Tuesday, 2012 August
7
A B C E D F 29 Tuesday, 2012 August
7
Peeking Under the Hood 30 Tuesday, 2012 August 7
A B C E D F master foo HEAD 31
Tuesday, 2012 August 7
Hash ALL the things f4b0043b2bc107524d09b1640f9f32c809005474 cd88047e5d30663d7c158a1e6b0d5b2161faad32 32 Tuesday, 2012 August
7
772be54 1b2b4c0 a7b938f 662009f 35ab7c0 3821f34 master foo HEAD 33
Tuesday, 2012 August 7
Branches and tags 34 Tuesday, 2012 August 7
A B C E D F master foo HEAD 35
Tuesday, 2012 August 7
HEAD 36 Tuesday, 2012 August 7
Fun with Graphs 37 Tuesday, 2012 August 7
A B C E D F master foo HEAD 38
Tuesday, 2012 August 7
git commit 39 Tuesday, 2012 August 7
git commit A B C E D F master foo
HEAD A B C E D F master foo HEAD 40 Tuesday, 2012 August 7
git commit git commit -m ‘blah blah blah’ A B
C E D F master foo HEAD A B C E D F master foo HEAD 40 Tuesday, 2012 August 7
git commit git commit -m ‘blah blah blah’ A B
C E D F G master foo HEAD A B C E D F G master foo HEAD 40 Tuesday, 2012 August 7
git commit git commit -m ‘blah blah blah’ A B
C E D F G master foo HEAD A B C E D F G master foo HEAD 40 Tuesday, 2012 August 7
git reset 41 Tuesday, 2012 August 7
git reset A B C E D F G master
foo HEAD A B C E D F G master foo HEAD 42 Tuesday, 2012 August 7
git reset git reset F A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 42 Tuesday, 2012 August 7
git reset git reset F A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 42 Tuesday, 2012 August 7
git checkout 43 Tuesday, 2012 August 7
git checkout A B C E D F G master
foo HEAD A B C E D F G master foo HEAD 44 Tuesday, 2012 August 7
git checkout git checkout master A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 44 Tuesday, 2012 August 7
git checkout git checkout master A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 44 Tuesday, 2012 August 7
git checkout A B C E D F G master
foo HEAD A B C E D F G master foo HEAD 45 Tuesday, 2012 August 7
git checkout git checkout F A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 45 Tuesday, 2012 August 7
git checkout git checkout F A B C E D
F G master foo HEAD A B C E D F G master foo HEAD 45 Tuesday, 2012 August 7
git checkout git checkout F A B C E D
F G master foo HEAD A B C E D F G master foo HEAD DETACHED HEAD 45 Tuesday, 2012 August 7
git branch 46 Tuesday, 2012 August 7
git branch A B C E D F G master
foo HEAD 47 Tuesday, 2012 August 7
git branch A B C E D F G master
foo HEAD git branch bar 47 Tuesday, 2012 August 7
git branch A B C E D F G master
foo bar HEAD 48 Tuesday, 2012 August 7
git merge 49 Tuesday, 2012 August 7
git merge A B C E D F G master
foo HEAD 50 Tuesday, 2012 August 7
git merge A B C E D F G master
foo HEAD git merge foo 50 Tuesday, 2012 August 7
git merge A B C E D H F G
master foo HEAD 51 Tuesday, 2012 August 7
git merge A B C E D H F G
master foo HEAD 52 Tuesday, 2012 August 7
git rebase 53 Tuesday, 2012 August 7
git rebase A B C E D F G master
foo HEAD 54 Tuesday, 2012 August 7
git rebase A B C E D F G master
foo HEAD git rebase master 54 Tuesday, 2012 August 7
git rebase A B C D E' F' G' master
foo HEAD 55 Tuesday, 2012 August 7
Remotes 56 Tuesday, 2012 August 7
What are remotes? 57 Tuesday, 2012 August 7
What are remotes? Any repository that’s not your current one!
57 Tuesday, 2012 August 7
Another directory on your machine /some/repo/path Another server https://github.com/erynofwales/shortcake.git ssh://
[email protected]
:erynofwales/shortcake.git
git://github.com/erynofwales/shortcake.git 58 Tuesday, 2012 August 7
Remote branches origin/master 59 Tuesday, 2012 August 7
How do you make remotes? 60 Tuesday, 2012 August 7
How do you make remotes? With git remote! 60 Tuesday,
2012 August 7
git remote and git remote -v git remote add git
remote rm 61 Tuesday, 2012 August 7
git clone 62 Tuesday, 2012 August 7
A B C E D F master foo HEAD GITHUB
63 Tuesday, 2012 August 7
A B C E D F master foo HEAD GITHUB
A B C E D F master foo HEAD LOCAL 63 Tuesday, 2012 August 7
git fetch 64 Tuesday, 2012 August 7
git fetch A B C E D F G master
foo HEAD 65 Tuesday, 2012 August 7
git fetch A B C E D F G master
foo HEAD git fetch origin foo 65 Tuesday, 2012 August 7
git fetch A B C E D F G H
master foo origin/foo HEAD FETCH_HEAD 66 Tuesday, 2012 August 7
git fetch A B C E D F G H
master foo origin/foo HEAD FETCH_HEAD git merge origin/foo 66 Tuesday, 2012 August 7
git fetch A B C E D F G H
master foo origin/foo HEAD 67 Tuesday, 2012 August 7
git pull 68 Tuesday, 2012 August 7
git pull A B C E D F G master
foo HEAD 69 Tuesday, 2012 August 7
git pull A B C E D F G master
foo HEAD git pull origin foo 69 Tuesday, 2012 August 7
git pull A B C E D F G H
master foo origin/foo HEAD 70 Tuesday, 2012 August 7
git push 71 Tuesday, 2012 August 7
git pull A B C E D F G H
master foo origin/foo HEAD 72 Tuesday, 2012 August 7
git pull git push origin foo A B C E
D F G H master foo origin/foo HEAD 72 Tuesday, 2012 August 7
git pull A B C E D F G H
master foo origin/foo HEAD 73 Tuesday, 2012 August 7
GitHub 74 Tuesday, 2012 August 7
SSH Keys 75 Tuesday, 2012 August 7
Creating Repositories 76 Tuesday, 2012 August 7
Forking 77 Tuesday, 2012 August 7
Pull Requests 78 Tuesday, 2012 August 7
Tweaking Git 79 Tuesday, 2012 August 7
git config and .gitconfig 80 Tuesday, 2012 August 7
[user] ! name = Eryn Wells ! email =
[email protected]
[core] editor = vim quotepath = false [color] ui = auto [merge] tool = vimdiff [alias] st = status co = checkout ci = commit br = branch lg = log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative push = push -u [ui] ! color = true [mergetool] ! keepBackup = true 81 Tuesday, 2012 August 7
Personal stuff git config user.name “Your Name” git config user.email
“
[email protected]
” 82 Tuesday, 2012 August 7
Aliases git config --set alias.[name] “big long command” 83 Tuesday,
2012 August 7
Aliases git config alias.st status git config alias.br branch 83
Tuesday, 2012 August 7
Aliases git config alias.co checkout git config alias.ci commit 83
Tuesday, 2012 August 7
Aliases git config alias.lg “log --graph --pretty=format:'%Cred%h %Creset -%C(yellow)%d%Creset %s
%Cgreen(%cr) %C(bold blue)< %an>%Creset' --abbrev-commit --date=relative” 83 Tuesday, 2012 August 7
.gitignore 84 Tuesday, 2012 August 7
*.log *.pot *.pyc local_settings.py 85 Tuesday, 2012 August 7
# Xcode build/* *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3
!default.perspectivev3 *.xcworkspace !default.xcworkspace xcuserdata profile *.moved-aside 86 Tuesday, 2012 August 7
Questions? 87 Tuesday, 2012 August 7