SlideShare a Scribd company logo
Git Basics II
Credit to Git (http://git-scm.com/book)
http://byte.kde.org/~zrusin/git/git-cheat-sheet-medium.png
More git operations!
● There are a lot more git operations
available than was covered last session
● To see them all, git help -a
● We will cover a few more of them this class
git revert
• Remember those hashcodes seen in a log?
Any commit or merge can be reverted by
using git revert <hashcode>.
• Merges, remember to use -m # as a
parameter. -m1 specifies the parent, -m2
specifies the 2nd mainline
• Reverts may require conflict resolution.
git rebase
First, a warning:
Make every effort not to rebase after you’ve
pushed commits to a public repo. Other devs
may get pissed!
A detour - revision notation
HEAD pointer
^ - parent operator (difference between ^^
and ^#)
~ - depthwise operator
<between>..<and> - ranges and sets
git rebase
ex. git rebase --interactive HEAD~5
Rewinds and reapplies commits
Lists the commits to be rebased, select from
options to rebase
p = pick (use commit) s=squash (combine)
r = reword (commit message) f=fixup
e = edit (amend) x=exec
More git commit options
Cherry-picking
Picking individual commits/merges from repo
Using gerrit or github
• Requires a defined remote
• Sequence is fetch, cherry-pick,(auto)merge
• Ex: git fetch
https://gerrit.omnirom.org/android_frame
works_base refs/changes/58/6658/1 && git
cherry-pick FETCH_HEAD
git stash
Takes your workspace and all the changed
files and saves onto a stack of unfinished
changes
• git stash
• git stash list
• git stash apply
• git stash pop
git clean
Remove untracked files from the working
tree.
-d also remove untracked files
-f force
For those who like to derp: --i, --dry-run
More tricks using git
git log --branches --not --remotes --oneline
git diff --word-diff
git status -sb
PS1='[u@h W$(__git_ps1 " (%s)")]$ '
git cherry -v <branch>
git grep
Print lines in a repository matching a pattern
git grep <regexp>
git tag
Place a descriptive tag at this point in the
history.
Good for identifying major releases - Google
uses this profusely for AOSP
git tag build6; git push th build6
git reflog - the ultimate derp fixer!
Gives you a concise history of all your
changes, whether they be merges, rebases,
reverts, commits
If you make a mistake, you can always try
merging in a reflog tag!
Example...
Using git bisect to track bugs
git bisect does a binary search through your
command history
git bisect start
git bisect bad
git bisect good [<commit id>]
git bisect reset

More Related Content

What's hot

Introduction to Go scheduler
Introduction to Go schedulerIntroduction to Go scheduler
Introduction to Go scheduler
Bin Wang
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
Abdul Basit
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer CheatsheetAbdul Basit
 
Ohh shit git
Ohh shit gitOhh shit git
Ohh shit git
Jesse Houwing
 
シェル芸による git rev-list
シェル芸による git rev-listシェル芸による git rev-list
シェル芸による git rev-list
Kazuya Kohara
 
Gitting better
Gitting betterGitting better
Gitting better
Gregory Bataille
 
GStreamer Instruments
GStreamer InstrumentsGStreamer Instruments
GStreamer Instruments
Kyrylo Polezhaiev
 
ggplotのplotエリアで日本語ラベルを使う
ggplotのplotエリアで日本語ラベルを使うggplotのplotエリアで日本語ラベルを使う
ggplotのplotエリアで日本語ラベルを使う
Tsuda University Institute for Mathematics and Computer Science
 
Git's Filter Branch Command
Git's Filter Branch CommandGit's Filter Branch Command
Git's Filter Branch Command
Matthew McCullough
 
RaspberryPiで作るガイガーカウンター
RaspberryPiで作るガイガーカウンターRaspberryPiで作るガイガーカウンター
RaspberryPiで作るガイガーカウンター
Yu Kusanagi
 

What's hot (12)

Introduction to Go scheduler
Introduction to Go schedulerIntroduction to Go scheduler
Introduction to Go scheduler
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
 
Git Developer Cheatsheet
Git Developer CheatsheetGit Developer Cheatsheet
Git Developer Cheatsheet
 
Git
GitGit
Git
 
Ohh shit git
Ohh shit gitOhh shit git
Ohh shit git
 
シェル芸による git rev-list
シェル芸による git rev-listシェル芸による git rev-list
シェル芸による git rev-list
 
Gitting better
Gitting betterGitting better
Gitting better
 
GStreamer Instruments
GStreamer InstrumentsGStreamer Instruments
GStreamer Instruments
 
ggplotのplotエリアで日本語ラベルを使う
ggplotのplotエリアで日本語ラベルを使うggplotのplotエリアで日本語ラベルを使う
ggplotのplotエリアで日本語ラベルを使う
 
Git's Filter Branch Command
Git's Filter Branch CommandGit's Filter Branch Command
Git's Filter Branch Command
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
RaspberryPiで作るガイガーカウンター
RaspberryPiで作るガイガーカウンターRaspberryPiで作るガイガーカウンター
RaspberryPiで作るガイガーカウンター
 

Viewers also liked

Family
FamilyFamily
BBCL Navarathina - Apartments in Ambattur - Construction Progress
BBCL Navarathina - Apartments in Ambattur - Construction ProgressBBCL Navarathina - Apartments in Ambattur - Construction Progress
BBCL Navarathina - Apartments in Ambattur - Construction ProgressBBCL Marketing
 
Gerrit class
Gerrit classGerrit class
Gerrit class
Peter Carenza
 
Who Will Hire Me?
Who Will Hire Me?Who Will Hire Me?
Who Will Hire Me?j301752
 
Git Basics 1 Carenza
Git Basics 1 CarenzaGit Basics 1 Carenza
Git Basics 1 Carenza
Peter Carenza
 
Ountacentinela (1)
Ountacentinela (1)Ountacentinela (1)
Ountacentinela (1)
danielamedinap
 
Career planning Jenn Arce
Career planning Jenn ArceCareer planning Jenn Arce
Career planning Jenn Arcej301752
 
6класс
6класс6класс
6классivnik68
 
Vajra Site Progress Update June 2014
Vajra Site Progress Update June 2014Vajra Site Progress Update June 2014
Vajra Site Progress Update June 2014
BBCL Marketing
 

Viewers also liked (11)

Family
FamilyFamily
Family
 
BBCL Navarathina - Apartments in Ambattur - Construction Progress
BBCL Navarathina - Apartments in Ambattur - Construction ProgressBBCL Navarathina - Apartments in Ambattur - Construction Progress
BBCL Navarathina - Apartments in Ambattur - Construction Progress
 
Gerrit class
Gerrit classGerrit class
Gerrit class
 
Who Will Hire Me?
Who Will Hire Me?Who Will Hire Me?
Who Will Hire Me?
 
U simportrequirements
U simportrequirementsU simportrequirements
U simportrequirements
 
Git Basics 1 Carenza
Git Basics 1 CarenzaGit Basics 1 Carenza
Git Basics 1 Carenza
 
Ountacentinela (1)
Ountacentinela (1)Ountacentinela (1)
Ountacentinela (1)
 
Career planning Jenn Arce
Career planning Jenn ArceCareer planning Jenn Arce
Career planning Jenn Arce
 
6класс
6класс6класс
6класс
 
Keyword Pada Bahasa C
Keyword Pada Bahasa CKeyword Pada Bahasa C
Keyword Pada Bahasa C
 
Vajra Site Progress Update June 2014
Vajra Site Progress Update June 2014Vajra Site Progress Update June 2014
Vajra Site Progress Update June 2014
 

Similar to Git basics 2

Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 
Git
GitGit
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
mobaires
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
Shinho Kang
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践Terry Wang
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践Terry Wang
 
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
 
Git
Git Git
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
Jesús Miguel Benito Calzada
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Katie Sylor-Miller
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Git a stupid change tracker and persistent map.
Git a stupid change tracker and persistent map.Git a stupid change tracker and persistent map.
Git a stupid change tracker and persistent map.
Pitambar Jha
 

Similar to Git basics 2 (20)

Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Git
GitGit
Git
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git commands
Git commandsGit commands
Git commands
 
Git
Git Git
Git
 
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git a stupid change tracker and persistent map.
Git a stupid change tracker and persistent map.Git a stupid change tracker and persistent map.
Git a stupid change tracker and persistent map.
 

Recently uploaded

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 

Recently uploaded (20)

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 

Git basics 2

  • 1. Git Basics II Credit to Git (http://git-scm.com/book) http://byte.kde.org/~zrusin/git/git-cheat-sheet-medium.png
  • 2. More git operations! ● There are a lot more git operations available than was covered last session ● To see them all, git help -a ● We will cover a few more of them this class
  • 3. git revert • Remember those hashcodes seen in a log? Any commit or merge can be reverted by using git revert <hashcode>. • Merges, remember to use -m # as a parameter. -m1 specifies the parent, -m2 specifies the 2nd mainline • Reverts may require conflict resolution.
  • 4. git rebase First, a warning: Make every effort not to rebase after you’ve pushed commits to a public repo. Other devs may get pissed!
  • 5. A detour - revision notation HEAD pointer ^ - parent operator (difference between ^^ and ^#) ~ - depthwise operator <between>..<and> - ranges and sets
  • 6. git rebase ex. git rebase --interactive HEAD~5 Rewinds and reapplies commits Lists the commits to be rebased, select from options to rebase p = pick (use commit) s=squash (combine) r = reword (commit message) f=fixup e = edit (amend) x=exec
  • 7. More git commit options
  • 8. Cherry-picking Picking individual commits/merges from repo Using gerrit or github • Requires a defined remote • Sequence is fetch, cherry-pick,(auto)merge • Ex: git fetch https://gerrit.omnirom.org/android_frame works_base refs/changes/58/6658/1 && git cherry-pick FETCH_HEAD
  • 9. git stash Takes your workspace and all the changed files and saves onto a stack of unfinished changes • git stash • git stash list • git stash apply • git stash pop
  • 10. git clean Remove untracked files from the working tree. -d also remove untracked files -f force For those who like to derp: --i, --dry-run
  • 11. More tricks using git git log --branches --not --remotes --oneline git diff --word-diff git status -sb PS1='[u@h W$(__git_ps1 " (%s)")]$ ' git cherry -v <branch>
  • 12. git grep Print lines in a repository matching a pattern git grep <regexp>
  • 13. git tag Place a descriptive tag at this point in the history. Good for identifying major releases - Google uses this profusely for AOSP git tag build6; git push th build6
  • 14. git reflog - the ultimate derp fixer! Gives you a concise history of all your changes, whether they be merges, rebases, reverts, commits If you make a mistake, you can always try merging in a reflog tag! Example...
  • 15. Using git bisect to track bugs git bisect does a binary search through your command history git bisect start git bisect bad git bisect good [<commit id>] git bisect reset