SlideShare a Scribd company logo
1 of 13
Git in 10 minutes 
- eliminate confusions
Content 
● What is git? - 30 seconds 
● How it works? - 2 minutes 
● Github flow - 3 minutes 
● Frequently Used Commands - 2 minutes 
● Confusions on Undo- 2 minutes 
● Useful links - 30 seconds
Git 
● Distributed version control system 
Although git allows to have multiple remote repositories, usually we maintain only one remote 
repository, that is ‘origin’. 
Associated command: git remote -v
Git
How it works 
Nearly all operations are local. 
- git branch 
- git checkout 
- git status 
- git commit 
- git merge 
Remote operations 
- git pull (Actually: git fetch + git merge) 
- git push
How it works
Github flow 
1.Create branch 2.Commit 3.Pull request 4.Commit 5. Merge to master
Github flow & our toppings 
1. Create branch 
git checkout master 
git pull 
git checkout -b feature1 
2.Commit 
git add filename.php 
git commit 
git push -u origin feature1 
3. Pull request : Not directly connected to git operation 
4.Commit 
git add filename.php 
git commit 
git push 
5.Merge to master 
git checkout master 
git pull 
git merge feature1 
git push
Frequently Used Commands 
● If you have done so many unnecessary changes in different files and now you want to discard all the changes ( before 
working at cool mind ) : 
git reset --hard 
● Another most used command that is very useful when did commit but that was a mistake. What will you do? 
If you want to remove your last commit that has not been pushed yet: 
git reset --hard HEAD^ 
● To view unpushed git commits 
git log origin/master..HEAD 
● To create a local branch that will track remote branch 
git checkout -t origin/branchname 
● To see all commits of someone 
git log --author=Jon 
● To see all commits since last 2 weeks 
git log --since=2.weeks 
● To see the diff of a file which has already been added to stage 
git diff --cached example.txt
Confusions 
Undo: 
Action Command Output 
M git checkout filename - 
M > S git reset HEAD filename M 
M > S > C git reset --soft HEAD^ S 
M > S > C git reset --mixed HEAD^ M 
M > S > C git reset --hard HEAD^ - 
M > S > C > P git reset --hard HEAD^ 
git push -f origin branch-name 
- 
M = Modified 
S = Staged 
C = Committed 
P = Pushed
Confusions 
Undo: 
Delete local branch: git branch -d branch-name 
Delete remote branch: git push origin --delete branch-name 
git cherry 
git checkout production_branch 
git cherry dev_branch 
git cherry-pick 62ecb3
Useful links 
● http://git-scm.com/book/en/v2 
● http://rogerdudler.github.io/git-guide/ 
● https://www.codeschool.com/courses/try-git 
● http://www.pranjol.com/blog/66 
● stackoverflow and google :)
Thank you

More Related Content

What's hot

What's hot (20)

Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
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 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git commands
Git commandsGit commands
Git commands
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Learning git
Learning gitLearning git
Learning git
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
git and github
git and githubgit and github
git and github
 
Git flow
Git flowGit flow
Git flow
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 

Similar to Git in 10 minutes

Similar to Git in 10 minutes (20)

Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
 
Git
GitGit
Git
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
Lets Git Together
Lets Git TogetherLets Git Together
Lets Git Together
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Git cheat-sheet
Git cheat-sheetGit cheat-sheet
Git cheat-sheet
 
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
Git github
Git githubGit github
Git github
 
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
 
Git
GitGit
Git
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Git in 10 minutes

  • 1. Git in 10 minutes - eliminate confusions
  • 2. Content ● What is git? - 30 seconds ● How it works? - 2 minutes ● Github flow - 3 minutes ● Frequently Used Commands - 2 minutes ● Confusions on Undo- 2 minutes ● Useful links - 30 seconds
  • 3. Git ● Distributed version control system Although git allows to have multiple remote repositories, usually we maintain only one remote repository, that is ‘origin’. Associated command: git remote -v
  • 4. Git
  • 5. How it works Nearly all operations are local. - git branch - git checkout - git status - git commit - git merge Remote operations - git pull (Actually: git fetch + git merge) - git push
  • 7. Github flow 1.Create branch 2.Commit 3.Pull request 4.Commit 5. Merge to master
  • 8. Github flow & our toppings 1. Create branch git checkout master git pull git checkout -b feature1 2.Commit git add filename.php git commit git push -u origin feature1 3. Pull request : Not directly connected to git operation 4.Commit git add filename.php git commit git push 5.Merge to master git checkout master git pull git merge feature1 git push
  • 9. Frequently Used Commands ● If you have done so many unnecessary changes in different files and now you want to discard all the changes ( before working at cool mind ) : git reset --hard ● Another most used command that is very useful when did commit but that was a mistake. What will you do? If you want to remove your last commit that has not been pushed yet: git reset --hard HEAD^ ● To view unpushed git commits git log origin/master..HEAD ● To create a local branch that will track remote branch git checkout -t origin/branchname ● To see all commits of someone git log --author=Jon ● To see all commits since last 2 weeks git log --since=2.weeks ● To see the diff of a file which has already been added to stage git diff --cached example.txt
  • 10. Confusions Undo: Action Command Output M git checkout filename - M > S git reset HEAD filename M M > S > C git reset --soft HEAD^ S M > S > C git reset --mixed HEAD^ M M > S > C git reset --hard HEAD^ - M > S > C > P git reset --hard HEAD^ git push -f origin branch-name - M = Modified S = Staged C = Committed P = Pushed
  • 11. Confusions Undo: Delete local branch: git branch -d branch-name Delete remote branch: git push origin --delete branch-name git cherry git checkout production_branch git cherry dev_branch git cherry-pick 62ecb3
  • 12. Useful links ● http://git-scm.com/book/en/v2 ● http://rogerdudler.github.io/git-guide/ ● https://www.codeschool.com/courses/try-git ● http://www.pranjol.com/blog/66 ● stackoverflow and google :)