SlideShare a Scribd company logo
Ten Things You Didn't
                           Know Git And GitHub
                                Could Do
                                         Owen Ou
                                     @JingwenOwenOu
                     http://owenou.com/2012/01/13/ten-things-you-didnt-
                              know-git-and-github-could-do.html




Saturday, 19 January, 13
Agenda

                     • 10 GitHub tricks
                     • Demo of GitHub tricks
                     • 10 Git tricks
                     • Demo of Git tricks with pull request

Saturday, 19 January, 13
Ten GitHub Tricks




                             http://octodex.github.com/front-end-conftocat




Saturday, 19 January, 13
t: file finder




Saturday, 19 January, 13
w: branch filter




Saturday, 19 January, 13
?: list of shortcuts




Saturday, 19 January, 13
whitespace: ?w=1




Saturday, 19 January, 13
commits by range

                     • github.com/user/repo/compare/{range}
                     • range = sha1...sha2 or master...my-branch
                     • time can be considered:
                           master@{time}...master
                     • e.g. master@{2012-01-01}...master

Saturday, 19 January, 13
commits by range
                           https://github.com/rails/rails/compare/
                           master@{1.day.ago}...master




Saturday, 19 January, 13
commits by author


                     • github.com/user/repo/commits/branch
                     • appending param ?author=github_handle


Saturday, 19 January, 13
commits by author
                           https://github.com/dynjs/dynjs/commits/
                           master?author=jingweno




Saturday, 19 January, 13
.diff & .patch

                     • Add .diff or .patch to the URLs of compare
                           view, pull request or commit page
                     • diff or patch in text format
                     • e.g., easy for building tools


Saturday, 19 January, 13
.diff & .patch
                           https://github.com/rails/rails/compare/
                           master@{1.day.ago}...master.patch




Saturday, 19 January, 13
email reply




Saturday, 19 January, 13
line linking

                     • any file view
                     • click one line or multiple lines by pressing
                           SHIFT
                     • good for sharing link to a chunk of code


Saturday, 19 January, 13
line linking
                           https://github.com/jingweno/dotfiles/blob/
                           master/.gitconfig#L5-L9




Saturday, 19 January, 13
subscribing peoples
                           Mentioning users in pull requests, issues or
                           any comment will subscribe them to all
                           subsequent notifications




Saturday, 19 January, 13
autolink
                     • In pull requests, issues or any comment, sha
                           and issue number will be automatically
                           linked
                     • link sha or issue number from another
                           repository with the format of user/
                           repo@sha1 or user/repo#1
                     • e.g. rails/rails#1
Saturday, 19 January, 13
autolink




Saturday, 19 January, 13
hub

                     • command line GitHub
                     • brew install hub or gem install hub
                     • hub pull-request
                     • https://github.com/defunkt/hub

Saturday, 19 January, 13
Demo: GitHub Tricks
                     •     shortcuts: t, w, ?

                     •     ignoring whitespace: https://github.com/dynjs/dynjs/commit/
                           45ec2e9c08ad10fc28c7a6c3016ef2eab158e20e

                     •     commits by range: https://github.com/acl-services/accounts/compare/
                           master@{yesterday}...master

                     •     commits by author: https://github.com/dynjs/dynjs/commits/master?
                           author=jingweno

                     •     line linking: https://github.com/acl-services/devise-acl/blob/master/Gemfile




Saturday, 19 January, 13
Ten Git Tricks




Saturday, 19 January, 13
git log -p FILE




Saturday, 19 January, 13
git log -S'PATTERN'




Saturday, 19 January, 13
git add -p




Saturday, 19 January, 13
git rm --cached FILE




Saturday, 19 January, 13
git log ..BRANCH




Saturday, 19 January, 13
git branch --merged &
                   git branch --no-merged




Saturday, 19 January, 13
git branch --contains
                                   SHA




Saturday, 19 January, 13
git status -s




Saturday, 19 January, 13
git reflog




Saturday, 19 January, 13
git shortlog -sn




Saturday, 19 January, 13
Create Shortcuts!




Saturday, 19 January, 13
Demo: Git Tricks with
                          Pull Request

                     •     Fix the README of devise-acl

                     •     gem install omglog

                     •     hub pull-request

                     •     rebase vs. merge vs. merge --no-ff




Saturday, 19 January, 13
References
                     •     http://owenou.com/2012/01/13/ten-things-you-didnt-know-git-and-github-
                           could-do.html

                     •     ProGit: http://git-scm.com/book

                     •     Advanced Git serials by Peepcode: https://peepcode.com/products/
                           advanced-git

                     •     Git and GitHub Secrets talk by Zach Holman: http://zachholman.com/talk/
                           git-github-secrets

                     •     GitFlow: http://nvie.com/posts/a-successful-git-branching-model




Saturday, 19 January, 13
Q &A




                           http://octodex.github.com/gangnamtocat.md




Saturday, 19 January, 13

More Related Content

Viewers also liked

First Touch with OSGi
First Touch with OSGiFirst Touch with OSGi
First Touch with OSGi
Owen Ou
 
Pde build
Pde buildPde build
Pde build
Owen Ou
 
Implementing a command line client to GitHub in Go
Implementing a command line client to GitHub in GoImplementing a command line client to GitHub in Go
Implementing a command line client to GitHub in Go
Owen Ou
 
Introducing eclipse rap
Introducing eclipse rapIntroducing eclipse rap
Introducing eclipse rap
Owen Ou
 
Full stackagile - Squads Chapters Tribes and Guilds
Full stackagile - Squads Chapters Tribes and GuildsFull stackagile - Squads Chapters Tribes and Guilds
Full stackagile - Squads Chapters Tribes and Guilds
Ashley-Christian Hardy
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
Kirsty Hulse
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
Post Planner
 
Culture
CultureCulture
Culture
Reed Hastings
 

Viewers also liked (9)

First Touch with OSGi
First Touch with OSGiFirst Touch with OSGi
First Touch with OSGi
 
Pde build
Pde buildPde build
Pde build
 
Implementing a command line client to GitHub in Go
Implementing a command line client to GitHub in GoImplementing a command line client to GitHub in Go
Implementing a command line client to GitHub in Go
 
Introducing eclipse rap
Introducing eclipse rapIntroducing eclipse rap
Introducing eclipse rap
 
Full stackagile - Squads Chapters Tribes and Guilds
Full stackagile - Squads Chapters Tribes and GuildsFull stackagile - Squads Chapters Tribes and Guilds
Full stackagile - Squads Chapters Tribes and Guilds
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Culture
CultureCulture
Culture
 

Similar to Ten Things You Didn't Know Git And GitHub Could Do

Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your Life
Mark Kelnar
 
RailsGirls Rotterdam - Github (and Octocats!)
RailsGirls Rotterdam - Github (and Octocats!)RailsGirls Rotterdam - Github (and Octocats!)
RailsGirls Rotterdam - Github (and Octocats!)
Anton Bangratz
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
Sujata Regoti
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDE
Evan Lin
 
EuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source projectEuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source project
Max Tepkeev
 
A byte of git
A byte of gitA byte of git
A byte of git
Weng Wei
 
Python korea 2012 11-24-github
Python korea 2012 11-24-githubPython korea 2012 11-24-github
Python korea 2012 11-24-github
LINE株式会社
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
Tack Mobile
 
Git_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdfGit_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdf
AshokChakravarthy27
 
Etsy chef-workflow
Etsy chef-workflowEtsy chef-workflow
Etsy chef-workflow
Daniel Schauenberg
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
Hiroshi SHIBATA
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
Otto Kekäläinen
 
Thinking in Git
Thinking in GitThinking in Git
Thinking in Git
Great Wide Open
 
Sinatra Heroku You And You - Keynote Format
Sinatra Heroku You And You - Keynote FormatSinatra Heroku You And You - Keynote Format
Sinatra Heroku You And You - Keynote Format
Adam Lowe
 
Sinatra Heroku You And You - PDF Format
Sinatra Heroku You And You - PDF FormatSinatra Heroku You And You - PDF Format
Sinatra Heroku You And You - PDF Format
Adam Lowe
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSockets
Gunnar Hillert
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
mwrather
 
Codemotion 2013 - presentación cocoa pods
Codemotion  2013 -  presentación cocoa podsCodemotion  2013 -  presentación cocoa pods
Codemotion 2013 - presentación cocoa pods
Jorge Maroto
 
Versions
VersionsVersions
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
Olmo F. Maldonado
 

Similar to Ten Things You Didn't Know Git And GitHub Could Do (20)

Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your Life
 
RailsGirls Rotterdam - Github (and Octocats!)
RailsGirls Rotterdam - Github (and Octocats!)RailsGirls Rotterdam - Github (and Octocats!)
RailsGirls Rotterdam - Github (and Octocats!)
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDE
 
EuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source projectEuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source project
 
A byte of git
A byte of gitA byte of git
A byte of git
 
Python korea 2012 11-24-github
Python korea 2012 11-24-githubPython korea 2012 11-24-github
Python korea 2012 11-24-github
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Git_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdfGit_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdf
 
Etsy chef-workflow
Etsy chef-workflowEtsy chef-workflow
Etsy chef-workflow
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Thinking in Git
Thinking in GitThinking in Git
Thinking in Git
 
Sinatra Heroku You And You - Keynote Format
Sinatra Heroku You And You - Keynote FormatSinatra Heroku You And You - Keynote Format
Sinatra Heroku You And You - Keynote Format
 
Sinatra Heroku You And You - PDF Format
Sinatra Heroku You And You - PDF FormatSinatra Heroku You And You - PDF Format
Sinatra Heroku You And You - PDF Format
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSockets
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
Codemotion 2013 - presentación cocoa pods
Codemotion  2013 -  presentación cocoa podsCodemotion  2013 -  presentación cocoa pods
Codemotion 2013 - presentación cocoa pods
 
Versions
VersionsVersions
Versions
 
Intro. to Git and Github
Intro. to Git and GithubIntro. to Git and Github
Intro. to Git and Github
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 

Ten Things You Didn't Know Git And GitHub Could Do

  • 1. Ten Things You Didn't Know Git And GitHub Could Do Owen Ou @JingwenOwenOu http://owenou.com/2012/01/13/ten-things-you-didnt- know-git-and-github-could-do.html Saturday, 19 January, 13
  • 2. Agenda • 10 GitHub tricks • Demo of GitHub tricks • 10 Git tricks • Demo of Git tricks with pull request Saturday, 19 January, 13
  • 3. Ten GitHub Tricks http://octodex.github.com/front-end-conftocat Saturday, 19 January, 13
  • 4. t: file finder Saturday, 19 January, 13
  • 6. ?: list of shortcuts Saturday, 19 January, 13
  • 8. commits by range • github.com/user/repo/compare/{range} • range = sha1...sha2 or master...my-branch • time can be considered: master@{time}...master • e.g. master@{2012-01-01}...master Saturday, 19 January, 13
  • 9. commits by range https://github.com/rails/rails/compare/ master@{1.day.ago}...master Saturday, 19 January, 13
  • 10. commits by author • github.com/user/repo/commits/branch • appending param ?author=github_handle Saturday, 19 January, 13
  • 11. commits by author https://github.com/dynjs/dynjs/commits/ master?author=jingweno Saturday, 19 January, 13
  • 12. .diff & .patch • Add .diff or .patch to the URLs of compare view, pull request or commit page • diff or patch in text format • e.g., easy for building tools Saturday, 19 January, 13
  • 13. .diff & .patch https://github.com/rails/rails/compare/ master@{1.day.ago}...master.patch Saturday, 19 January, 13
  • 15. line linking • any file view • click one line or multiple lines by pressing SHIFT • good for sharing link to a chunk of code Saturday, 19 January, 13
  • 16. line linking https://github.com/jingweno/dotfiles/blob/ master/.gitconfig#L5-L9 Saturday, 19 January, 13
  • 17. subscribing peoples Mentioning users in pull requests, issues or any comment will subscribe them to all subsequent notifications Saturday, 19 January, 13
  • 18. autolink • In pull requests, issues or any comment, sha and issue number will be automatically linked • link sha or issue number from another repository with the format of user/ repo@sha1 or user/repo#1 • e.g. rails/rails#1 Saturday, 19 January, 13
  • 20. hub • command line GitHub • brew install hub or gem install hub • hub pull-request • https://github.com/defunkt/hub Saturday, 19 January, 13
  • 21. Demo: GitHub Tricks • shortcuts: t, w, ? • ignoring whitespace: https://github.com/dynjs/dynjs/commit/ 45ec2e9c08ad10fc28c7a6c3016ef2eab158e20e • commits by range: https://github.com/acl-services/accounts/compare/ master@{yesterday}...master • commits by author: https://github.com/dynjs/dynjs/commits/master? author=jingweno • line linking: https://github.com/acl-services/devise-acl/blob/master/Gemfile Saturday, 19 January, 13
  • 22. Ten Git Tricks Saturday, 19 January, 13
  • 23. git log -p FILE Saturday, 19 January, 13
  • 25. git add -p Saturday, 19 January, 13
  • 26. git rm --cached FILE Saturday, 19 January, 13
  • 27. git log ..BRANCH Saturday, 19 January, 13
  • 28. git branch --merged & git branch --no-merged Saturday, 19 January, 13
  • 29. git branch --contains SHA Saturday, 19 January, 13
  • 30. git status -s Saturday, 19 January, 13
  • 32. git shortlog -sn Saturday, 19 January, 13
  • 34. Demo: Git Tricks with Pull Request • Fix the README of devise-acl • gem install omglog • hub pull-request • rebase vs. merge vs. merge --no-ff Saturday, 19 January, 13
  • 35. References • http://owenou.com/2012/01/13/ten-things-you-didnt-know-git-and-github- could-do.html • ProGit: http://git-scm.com/book • Advanced Git serials by Peepcode: https://peepcode.com/products/ advanced-git • Git and GitHub Secrets talk by Zach Holman: http://zachholman.com/talk/ git-github-secrets • GitFlow: http://nvie.com/posts/a-successful-git-branching-model Saturday, 19 January, 13
  • 36. Q &A http://octodex.github.com/gangnamtocat.md Saturday, 19 January, 13