SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

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

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

Último

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 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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

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 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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

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