SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

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