SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

First Touch with OSGi
First Touch with OSGiFirst Touch with OSGi
First Touch with OSGiOwen Ou
 
Pde build
Pde buildPde build
Pde buildOwen 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 GoOwen Ou
 
Introducing eclipse rap
Introducing eclipse rapIntroducing eclipse rap
Introducing eclipse rapOwen 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 GuildsAshley-Christian Hardy
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty 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 PlanPost Planner
 

Andere mochten auch (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
 

Ähnlich wie 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 LifeMark 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 GithubSujata Regoti
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDEEvan 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 projectMax Tepkeev
 
A byte of git
A byte of gitA byte of git
A byte of gitWeng Wei
 
Python korea 2012 11-24-github
Python korea 2012 11-24-githubPython korea 2012 11-24-github
Python korea 2012 11-24-githubLINE株式会社
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android DevelopersTack Mobile
 
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 FormatAdam 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 FormatAdam Lowe
 
DevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsDevNexus 2013 - Introduction to WebSockets
DevNexus 2013 - Introduction to WebSocketsGunnar Hillert
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015mwrather
 
Codemotion 2013 - presentación cocoa pods
Codemotion  2013 -  presentación cocoa podsCodemotion  2013 -  presentación cocoa pods
Codemotion 2013 - presentación cocoa podsJorge Maroto
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

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