SlideShare uma empresa Scribd logo
1 de 35
Introduction to Git & Github
Roland Emmanuel Salunga
“Akio”
Data Analyst at Paydro
rsalunga29@gmail.com
https://www.linkedin.com/in/rsalunga29
Outline
• What is git?
• What is a Version Control System (VCS)?
• History of git
• Key concepts and basic git commands
• How does git works?
• What is Github?
• Basic Github Concepts
• Understanding Github workflow
What is git?
• Tracking your code revision history
• Unable to undo errors and roll back to earlier code
versions
• Sharing your codebase with a collaborator
• Merging collaborator’s code to your code
The problem
The solution
Version Control System
Git is a (Distributed) Version
Control System
What is a Version Control
System (VCS)?
Version Control System is…
• a way to manage files and directories
• a way to track and manage file changes so that you can
recall specific versions later
• a way to share a codebase to a collaborator without any
trouble
• a way to merge your collaborators code to your codebase
without having conflicts
Git isn’t the only VCS out there…
• Mercurial
• SVN - SubVersioN
• Perforce
• BitKeeper
but (we think) it’s the best!
History of git
• Created by Linus Torvalds in 2005
• Described by Linus as “the stupid content tracker”
• Originally created for the development of Linux kernel
• It’s written in C, Shell, Perl, Tcl, and Python
• Currently maintained by Junio Hamano since 2005
Key concepts and basic
git commands
• Snapshots:
• The way git tracks your codes and files history
• Records what your files look like overtime
• Commits:
• The act of creating a snapshot
• A whole git repository is made up of commits
• It contains 3 things:
• A hash code name which looks like this:
c456ae92da8e5fc1eec1587b278d37ed5d3baa04
• Information about how files and code changes
• A reference to the commit that came before it. Called a parent commit
Snapshot Example
Commit Example
• Repositories:
• A home for your files and their history of changes overtime
• Basically consists of all your commits and branches
• Can live on your local machine and/or on the cloud such as Github.
• Branches:
• Default branch is called the “master”
• A place where your unfinished features/modules lives before going
to master branch
• Contains a snapshot, history, and metadata of all your files
Repository Example
Branch Example
Basic git commands
• init
• Used to initialize a git repository from an existing directory of files.
• $ git init
• clone
• Used to get a copy of a project to your local machine
• $ git clone <repo url>
• status
• Used to view the status and changes of the directory and you’re working on and the
staging area.
• $ git status
• add
• Used to add files and directories to git staging area before you can commit them
• $ git add .
• $ git add <filename>
• commit
• Used to record a snapshot of git’s staging area
• $ git commit -m “Here is my commit message”
• reset
• Used to undo all changes and commits
• $ git reset
• pull
• Used to fetch files from remote repo (Github) and try to merge with your current branch
• $ git pull
• $ git pull origin <branch_name>
• push
• Used to push new branches and data in staging area to remote repo (Github)
• $ git push
• $ git push origin <branch_name>
• branch
• Used to create, manage, and list branches
• $ git branch
• $ git branch <branch_name>
• checkout
• Used to switch from branch to branch
• $ git checkout <branch_name>
• $ git checkout -b <branch_name>
• merge
• Used to merge a branch into your current branch
• $ git merge <branch_name>
• log
• Used to show the commit history of your current breach
• $ git log
How does git works?
Local
Machine
Basic Git Workflow
Staging
Area
(Local)
$ git add .
$ git commit -m “changes”
Master
branch
(Github)
$ git pull
$ git push
Git Workflow with Branch
Local
Machine
Staging
Area
(Local)
$ git checkout -b branch_1
$ git add .
$ git commit -m “changes”
Master
branch
(Github)
Branch_1
branch
(Github)
$ git push -u origin branch_1
$ git checkout master
$ git pull origin master
$ git merge branch_1
$ git push origin master
What is Github?
• Where do we store our repositories?
• Too many missing features in git (forking, pull requests,
security and privacy)
• Need to use third-party tool to document projects
• Git is a command-line tool
• Non-existent GUI and poor UX
The problem
The solution
Github
Issue Tracking
Pull Requests Tracking
Project Tasks Tracking
Documentation
Insights
Understanding Github
workflow
Source: https://guides.github.com/introduction/flow/
–Anonymous
“What is the most loyal tool of a programmer? Git,
because of its COMMITment!”

Mais conteúdo relacionado

Mais procurados

Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsCarl Brown
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to gitEmanuele Olivetti
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewRueful Robin
 

Mais procurados (20)

Learning git
Learning gitLearning git
Learning git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Git basics
Git basicsGit basics
Git basics
 
Git training v10
Git training v10Git training v10
Git training v10
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Github basics
Github basicsGithub basics
Github basics
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git
GitGit
Git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 

Semelhante a Introduction to Git and Github

An introduction to Git
An introduction to GitAn introduction to Git
An introduction to GitMuhil Vannan
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
11 git version control
11 git version control11 git version control
11 git version controlWasim Alatrash
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the starsStrannik_2013
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .HELLOWorld889594
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial IJim Yeh
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
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
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...WSO2
 

Semelhante a Introduction to Git and Github (20)

An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
11 git version control
11 git version control11 git version control
11 git version control
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Git.From thorns to the stars
Git.From thorns to the starsGit.From thorns to the stars
Git.From thorns to the stars
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Demo
DemoDemo
Demo
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Git hub
Git hubGit hub
Git hub
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
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
 
Git
GitGit
Git
 
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...Git workshop - University of Moratuwa, Department of Computer Science and Eng...
Git workshop - University of Moratuwa, Department of Computer Science and Eng...
 

Último

Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyPooja Nehwal
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCamilleBoulbin1
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Delhi Call girls
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 

Último (20)

Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 

Introduction to Git and Github

  • 2. Roland Emmanuel Salunga “Akio” Data Analyst at Paydro rsalunga29@gmail.com https://www.linkedin.com/in/rsalunga29
  • 3. Outline • What is git? • What is a Version Control System (VCS)? • History of git • Key concepts and basic git commands • How does git works? • What is Github? • Basic Github Concepts • Understanding Github workflow
  • 5. • Tracking your code revision history • Unable to undo errors and roll back to earlier code versions • Sharing your codebase with a collaborator • Merging collaborator’s code to your code The problem
  • 7. Git is a (Distributed) Version Control System
  • 8. What is a Version Control System (VCS)?
  • 9. Version Control System is… • a way to manage files and directories • a way to track and manage file changes so that you can recall specific versions later • a way to share a codebase to a collaborator without any trouble • a way to merge your collaborators code to your codebase without having conflicts
  • 10. Git isn’t the only VCS out there… • Mercurial • SVN - SubVersioN • Perforce • BitKeeper but (we think) it’s the best!
  • 12. • Created by Linus Torvalds in 2005 • Described by Linus as “the stupid content tracker” • Originally created for the development of Linux kernel • It’s written in C, Shell, Perl, Tcl, and Python • Currently maintained by Junio Hamano since 2005
  • 13. Key concepts and basic git commands
  • 14. • Snapshots: • The way git tracks your codes and files history • Records what your files look like overtime • Commits: • The act of creating a snapshot • A whole git repository is made up of commits • It contains 3 things: • A hash code name which looks like this: c456ae92da8e5fc1eec1587b278d37ed5d3baa04 • Information about how files and code changes • A reference to the commit that came before it. Called a parent commit
  • 16. • Repositories: • A home for your files and their history of changes overtime • Basically consists of all your commits and branches • Can live on your local machine and/or on the cloud such as Github. • Branches: • Default branch is called the “master” • A place where your unfinished features/modules lives before going to master branch • Contains a snapshot, history, and metadata of all your files
  • 20. • init • Used to initialize a git repository from an existing directory of files. • $ git init • clone • Used to get a copy of a project to your local machine • $ git clone <repo url> • status • Used to view the status and changes of the directory and you’re working on and the staging area. • $ git status • add • Used to add files and directories to git staging area before you can commit them • $ git add . • $ git add <filename>
  • 21. • commit • Used to record a snapshot of git’s staging area • $ git commit -m “Here is my commit message” • reset • Used to undo all changes and commits • $ git reset • pull • Used to fetch files from remote repo (Github) and try to merge with your current branch • $ git pull • $ git pull origin <branch_name> • push • Used to push new branches and data in staging area to remote repo (Github) • $ git push • $ git push origin <branch_name>
  • 22. • branch • Used to create, manage, and list branches • $ git branch • $ git branch <branch_name> • checkout • Used to switch from branch to branch • $ git checkout <branch_name> • $ git checkout -b <branch_name> • merge • Used to merge a branch into your current branch • $ git merge <branch_name> • log • Used to show the commit history of your current breach • $ git log
  • 23. How does git works?
  • 24. Local Machine Basic Git Workflow Staging Area (Local) $ git add . $ git commit -m “changes” Master branch (Github) $ git pull $ git push Git Workflow with Branch Local Machine Staging Area (Local) $ git checkout -b branch_1 $ git add . $ git commit -m “changes” Master branch (Github) Branch_1 branch (Github) $ git push -u origin branch_1 $ git checkout master $ git pull origin master $ git merge branch_1 $ git push origin master
  • 26. • Where do we store our repositories? • Too many missing features in git (forking, pull requests, security and privacy) • Need to use third-party tool to document projects • Git is a command-line tool • Non-existent GUI and poor UX The problem
  • 35. –Anonymous “What is the most loyal tool of a programmer? Git, because of its COMMITment!”