SlideShare une entreprise Scribd logo
1  sur  14
Intro to GIT
Gharpay – Friday 3/08/2012
Arpit Mohan
Version Control?
Why?
How?
Ctrl-C + Ctrl-V ( Most popular )
Centralized VCS ( Version Control System ) Eg.
SVN, Perforce.
Distributed VCS. Eg. Git, Mercurial

When?
Salient Features of Git
Distributed VCS. Each system is a complete
mirror of the repository.

Data integrity. All data is check-summed and
stored as the SHA1-ID.

Differential data. Capability to do-undo changes
without fear of data corruption.
Install GIT

You already know this! Else, try out the awesome
website a few friends, Sergey Brin and Larry
Page built – http://www.google.com 
Git Configuration
Identity – Very very important. It helps us identify who you are and
what you did. Associated tools like Jenkins, CruiseControl etc use
this identity to perform more functions.
$ git config --global user.name ”Arpit Mohan”
$ git config --global user.email arpit@gharpay.in

$ git config --global core.editor emacs (By default Vi/Vim)
$ git config --global merge.tool vimdiff ( I use Eclipse  )
$ git config –list
$ git help <action> - Some old methods never die!
$ git config --global alias.co checkout (You can setup multiple aliases)
All this is stored in ~/.gitconfig file. Check it out.
Few Git Paradigms
Working
Directory

Staging
Area

Git
Repository
(Local)

Git
Repository
(Remote)

• Distributed System. Every checkout is a snapshot. No loss of
data. Multiple copies.

• Primarily local operations. Very little interaction with remote
repository. Hence faster!

Untracked

Unmodified

Modified

Staged

Committed

Pushed
Git Commands
$ git status
$ git branch (To name the branch)
$ git add <filename> (To begin tracking a new file or stage a
file for commit)
$ vi .gitignore (Get Git to ignore files. Eg. Log files)
$ git commit –m “<Commit Message>” <filenames> (-a)

$ git rm <filename> Removes the file from local and repo.
$ git rm --cached <filename>
$ git mv <old_name> <new_file>
Git Logs (contd)
$ git log –pretty=oneline (Pretty print the log)
$ git log --pretty=format:"%h - %an, %ar : %s”
$ git log –graph
Amending the Tree
$ git commit –amend
Example:
$ git commit -m ’initial commit’
$ git add forgotten_file
$ git commit –amend

Be Careful while amending the tree because the
changes are permanent!
Remote Repository
$ git remote –v ( Name and URL of the remote
server)

$ git remote add <branch> <url of remote repo>
$ git fetch <branchname>
$ git remote rm <branchname> ( Use carefully)
$ git pull
Git Branches
Git branches are one of the most potent features
of Git. Learn it and it may just change your life!

$ git branch (List local branches)
-a : List all branches, local and remote
-t : Begin tracking a remote branch
-d : Delete a branch

$ git checkout –b <branchname>
origin/branchname (Creates a branch and tracks
the remote branchname)
Merging & Rebasing
$ git merge <branchname> ( Merging another
branch into this )

$ git rebase [basebranch] [topicbranch]( Plays
the child commits on the master )
Interesting things can be done with rebase. Look
at whiteboard!
IMP: Don’t rebase stuff that has been committed
to the remote repository! Such people are hated
and stoned 
Interesting Features
$ git bisect start
$ git bisect good
$ git bisect bad
$ git bisect reset
$ git bisect run testing.sh

$ git diff (Useless for binary files)
Add *.doc diff=word (In .gitattributes)
$ git config diff.word.textconv strings
Exiftool ( For JPEG Files)
Interesting Features
Hooks (Server side and Client side)
Pre-commit hooks
Post-commit hooks

$ git gc

Contenu connexe

Tendances

Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introductionAdam Lowry
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part AKazuchika Sekiya
 
Git it on (includes git hub)
Git it on (includes git hub)Git it on (includes git hub)
Git it on (includes git hub)Martin Bing
 
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Carina C. Zona
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 
How to become a Git power user
How to become a Git power userHow to become a Git power user
How to become a Git power userDeveo
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_pptMiraz Al-Mamun
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developersSebastian Witowski
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Git - Some tips to do it better
Git - Some tips to do it betterGit - Some tips to do it better
Git - Some tips to do it betterJonas De Smet
 
Git for beginner
Git for beginnerGit for beginner
Git for beginnerTrung Huynh
 
Why on earth is git super awesome?
Why on earth is git super awesome?Why on earth is git super awesome?
Why on earth is git super awesome?Chris Brown
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
git. WTF is it doing anyway?
git. WTF is it doing anyway?git. WTF is it doing anyway?
git. WTF is it doing anyway?Erin Zimmer
 

Tendances (20)

Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introduction
 
Git
GitGit
Git
 
Loading...git
Loading...gitLoading...git
Loading...git
 
お題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part Aお題でGroovyプログラミング: Part A
お題でGroovyプログラミング: Part A
 
Git it on (includes git hub)
Git it on (includes git hub)Git it on (includes git hub)
Git it on (includes git hub)
 
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
How to become a Git power user
How to become a Git power userHow to become a Git power user
How to become a Git power user
 
Git is my hero
Git is my heroGit is my hero
Git is my hero
 
Git
GitGit
Git
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git - Some tips to do it better
Git - Some tips to do it betterGit - Some tips to do it better
Git - Some tips to do it better
 
Git for beginner
Git for beginnerGit for beginner
Git for beginner
 
Why on earth is git super awesome?
Why on earth is git super awesome?Why on earth is git super awesome?
Why on earth is git super awesome?
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
git. WTF is it doing anyway?
git. WTF is it doing anyway?git. WTF is it doing anyway?
git. WTF is it doing anyway?
 
Git training
Git trainingGit training
Git training
 

Similaire à Introduction to GIT

Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Mizan Riqzia
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commandsZakaria Bouazza
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting StartedWildan Maulana
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubDSC GVP
 

Similaire à Introduction to GIT (20)

Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git
GitGit
Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git
GitGit
Git
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git and github
Git and githubGit and github
Git and github
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting Started
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 

Dernier

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Dernier (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Introduction to GIT

  • 1. Intro to GIT Gharpay – Friday 3/08/2012 Arpit Mohan
  • 2. Version Control? Why? How? Ctrl-C + Ctrl-V ( Most popular ) Centralized VCS ( Version Control System ) Eg. SVN, Perforce. Distributed VCS. Eg. Git, Mercurial When?
  • 3. Salient Features of Git Distributed VCS. Each system is a complete mirror of the repository. Data integrity. All data is check-summed and stored as the SHA1-ID. Differential data. Capability to do-undo changes without fear of data corruption.
  • 4. Install GIT You already know this! Else, try out the awesome website a few friends, Sergey Brin and Larry Page built – http://www.google.com 
  • 5. Git Configuration Identity – Very very important. It helps us identify who you are and what you did. Associated tools like Jenkins, CruiseControl etc use this identity to perform more functions. $ git config --global user.name ”Arpit Mohan” $ git config --global user.email arpit@gharpay.in $ git config --global core.editor emacs (By default Vi/Vim) $ git config --global merge.tool vimdiff ( I use Eclipse  ) $ git config –list $ git help <action> - Some old methods never die! $ git config --global alias.co checkout (You can setup multiple aliases) All this is stored in ~/.gitconfig file. Check it out.
  • 6. Few Git Paradigms Working Directory Staging Area Git Repository (Local) Git Repository (Remote) • Distributed System. Every checkout is a snapshot. No loss of data. Multiple copies. • Primarily local operations. Very little interaction with remote repository. Hence faster! Untracked Unmodified Modified Staged Committed Pushed
  • 7. Git Commands $ git status $ git branch (To name the branch) $ git add <filename> (To begin tracking a new file or stage a file for commit) $ vi .gitignore (Get Git to ignore files. Eg. Log files) $ git commit –m “<Commit Message>” <filenames> (-a) $ git rm <filename> Removes the file from local and repo. $ git rm --cached <filename> $ git mv <old_name> <new_file>
  • 8. Git Logs (contd) $ git log –pretty=oneline (Pretty print the log) $ git log --pretty=format:"%h - %an, %ar : %s” $ git log –graph
  • 9. Amending the Tree $ git commit –amend Example: $ git commit -m ’initial commit’ $ git add forgotten_file $ git commit –amend Be Careful while amending the tree because the changes are permanent!
  • 10. Remote Repository $ git remote –v ( Name and URL of the remote server) $ git remote add <branch> <url of remote repo> $ git fetch <branchname> $ git remote rm <branchname> ( Use carefully) $ git pull
  • 11. Git Branches Git branches are one of the most potent features of Git. Learn it and it may just change your life! $ git branch (List local branches) -a : List all branches, local and remote -t : Begin tracking a remote branch -d : Delete a branch $ git checkout –b <branchname> origin/branchname (Creates a branch and tracks the remote branchname)
  • 12. Merging & Rebasing $ git merge <branchname> ( Merging another branch into this ) $ git rebase [basebranch] [topicbranch]( Plays the child commits on the master ) Interesting things can be done with rebase. Look at whiteboard! IMP: Don’t rebase stuff that has been committed to the remote repository! Such people are hated and stoned 
  • 13. Interesting Features $ git bisect start $ git bisect good $ git bisect bad $ git bisect reset $ git bisect run testing.sh $ git diff (Useless for binary files) Add *.doc diff=word (In .gitattributes) $ git config diff.word.textconv strings Exiftool ( For JPEG Files)
  • 14. Interesting Features Hooks (Server side and Client side) Pre-commit hooks Post-commit hooks $ git gc