ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
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 (20)

Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
?
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
?
Github - Git Training ºÝºÝߣs: Foundations
Github - Git Training ºÝºÝߣs: FoundationsGithub - Git Training ºÝºÝߣs: Foundations
Github - Git Training ºÝºÝߣs: Foundations
Lee Hanxue
?
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
?
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
GoogleDeveloperStude4
?
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
?
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
?
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
?
Git and git flow
Git and git flowGit and git flow
Git and git flow
Fran Garc¨ªa
?
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
?
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
MohanRaviRohitth
?
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
Yoad Snapir
?
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
Otto Kek?l?inen
?
git - eine praktische Einf¨¹hrunggit - eine praktische Einf¨¹hrung
git - eine praktische Einf¨¹hrung
Marcel Eichner
?
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
?
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
?
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
?
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
?
Source control
Source controlSource control
Source control
Sachithra Gayan
?
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
?
Github - Git Training ºÝºÝߣs: Foundations
Github - Git Training ºÝºÝߣs: FoundationsGithub - Git Training ºÝºÝߣs: Foundations
Github - Git Training ºÝºÝߣs: Foundations
Lee Hanxue
?
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
?
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
?
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
?
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
Otto Kek?l?inen
?
git - eine praktische Einf¨¹hrunggit - eine praktische Einf¨¹hrung
git - eine praktische Einf¨¹hrung
Marcel Eichner
?
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
?
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
?
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
?

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
seungzzang Kim
?
Git tech talk
Git tech talkGit tech talk
Git tech talk
razasayed
?
Git
GitGit
Git
Parag Gupta
?
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Andy Slocum
?
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
Christoph Matthies
?
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
Javier Lafora Rey
?
Lets Git Together
Lets Git TogetherLets Git Together
Lets Git Together
Rakesh Jha
?
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
vimukthirandika
?
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
?
Git cheat-sheet
Git cheat-sheetGit cheat-sheet
Git cheat-sheet
MarcoRodas9
?
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
Rana Faisal Haroon
?
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
Hoffman Lab
?
Git github
Git githubGit github
Git github
Anurag Deb
?
Git tutorial
Git tutorialGit tutorial
Git tutorial
Pham Quy (Jack)
?
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
Yoram Michaeli
?
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
Piotr Benetkiewicz
?
Git
GitGit
Git
Terry Wang
?
Git ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ùGit ÈëÃÅÓëʵ¼ù
Git ÈëÃÅÓëʵ¼ù
Terry Wang
?
Git ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ùGit ÈëÃÅ Óë ʵ¼ù
Git ÈëÃÅ Óë ʵ¼ù
Terry Wang
?
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
?

Recently uploaded (20)

SE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.pptSE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.ppt
theworldimagine985
?
salesforce development services - Alt digital
salesforce development services - Alt digitalsalesforce development services - Alt digital
salesforce development services - Alt digital
Alt Digital Technologies
?
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
?
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
?
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
?
Cybersecurity & Innovation: The Future of Mobile App Development
Cybersecurity & Innovation: The Future of Mobile App DevelopmentCybersecurity & Innovation: The Future of Mobile App Development
Cybersecurity & Innovation: The Future of Mobile App Development
iProgrammer Solutions Private Limited
?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
Ava Isley
?
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
?
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
haroonsaeed605
?
CorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free downloadCorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free download
fahadmustafa4202
?
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen EngineRise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
stevebrudz1
?
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
?
LLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protectedLLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protected
Ivo Andreev
?
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
?
SketchUp Pro Crack [2025]-Free Download?
SketchUp Pro Crack [2025]-Free Download?SketchUp Pro Crack [2025]-Free Download?
SketchUp Pro Crack [2025]-Free Download?
kiran10101khan
?
AI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee SupportAI-Powered Chatbots for Employee Support
AI-Powered Chatbots for Employee Support
AutomationEdge Technologies
?
Build the future with Agentforce and Mulesoft
Build the future with Agentforce and  MulesoftBuild the future with Agentforce and  Mulesoft
Build the future with Agentforce and Mulesoft
GiulioPicchi
?
Account Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odooAccount Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odoo
AxisTechnolabs
?
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
?
Computer Architecture Patterson chapter 1 .ppt
Computer Architecture Patterson chapter 1 .pptComputer Architecture Patterson chapter 1 .ppt
Computer Architecture Patterson chapter 1 .ppt
jaysen110
?
SE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.pptSE- Lecture 5 for software development.ppt
SE- Lecture 5 for software development.ppt
theworldimagine985
?
salesforce development services - Alt digital
salesforce development services - Alt digitalsalesforce development services - Alt digital
salesforce development services - Alt digital
Alt Digital Technologies
?
AI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI AssistansAI Agents and More:Build Your AI Assistans
AI Agents and More:Build Your AI Assistans
HusseinMalikMammadli
?
EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]EASEUS Partition Master Crack with License Code [Latest]
EASEUS Partition Master Crack with License Code [Latest]
bhagasufyan
?
Metaverse Meetup: Explore Mulesoft MAC Project
Metaverse Meetup: Explore  Mulesoft MAC ProjectMetaverse Meetup: Explore  Mulesoft MAC Project
Metaverse Meetup: Explore Mulesoft MAC Project
GiulioPicchi
?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
ChatGPT and DeepSeek: Which AI Tool Delivers Better User Experience?
Ava Isley
?
SolidWorks 2025 Crack free Download updated
SolidWorks 2025 Crack  free Download updatedSolidWorks 2025 Crack  free Download updated
SolidWorks 2025 Crack free Download updated
sanasabaa73
?
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
AnyDesk Pro 3.7.0 Crack License Key Free Download 2025 [Latest]
haroonsaeed605
?
CorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free downloadCorelDRAW Graphics Suite 2025 Crack free download
CorelDRAW Graphics Suite 2025 Crack free download
fahadmustafa4202
?
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen EngineRise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
Rise of the Phoenix: Lesson Learned Build an AI-powered Test Gen Engine
stevebrudz1
?
How John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talkHow John started to like TDD (instead of hating it) - TED talk
How John started to like TDD (instead of hating it) - TED talk
Nacho Cougil
?
LLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protectedLLM Security - Smart to protect, but too smart to be protected
LLM Security - Smart to protect, but too smart to be protected
Ivo Andreev
?
iTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free DownloadiTop VPN Latest Version 2025 Crack Free Download
iTop VPN Latest Version 2025 Crack Free Download
lr74xqnvuf
?
SketchUp Pro Crack [2025]-Free Download?
SketchUp Pro Crack [2025]-Free Download?SketchUp Pro Crack [2025]-Free Download?
SketchUp Pro Crack [2025]-Free Download?
kiran10101khan
?
Build the future with Agentforce and Mulesoft
Build the future with Agentforce and  MulesoftBuild the future with Agentforce and  Mulesoft
Build the future with Agentforce and Mulesoft
GiulioPicchi
?
Account Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odooAccount Cash Flow Statement Report Generate in odoo
Account Cash Flow Statement Report Generate in odoo
AxisTechnolabs
?
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
arshadkhokher01
?
Computer Architecture Patterson chapter 1 .ppt
Computer Architecture Patterson chapter 1 .pptComputer Architecture Patterson chapter 1 .ppt
Computer Architecture Patterson chapter 1 .ppt
jaysen110
?

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 :)