SlideShare a Scribd company logo
Intro to Git and GitHub
Boston Code Camp 2018
Andrew Babiec
2018-04-07
Intro to Git and Github
What is Git?
Distributed Version Control System
 Version Control System: track changes to source code: who, what, why, when
Centralized vs. Distributed
Centralized repository Distributed repository
Git - Distributed Version Control System
Git Repository (repo/project)
 Entire collection of files and folders, along with full history
Characteristics
 Local & offline - Entire timeline/history of changes
 Snapshots, not deltas
 Changes are always additions
File history - snapshots in time called commits
Git data structure – Commit, Tree, Blob
Commit linked-list relationship
Git Branches
Exist at the repository level
 A branch applies to the entire repository
 Unlike most centralized version control tools where branches exist inside the
repository
 Default branch is ‘Master’
 Can be local or remote
Exceptionally lightweight
 Implemented as a pointer to a commit in the graph
 Exist only in the local repository until they’re explicitly shared
 Encourages feature branching
Checkout – switch branch
Git Data Model
Intro to Git and Github
Intro to Git and Github
Intro to Git and Github
Git Two Stage Commit
Working/modified/workspace > Staging (index) > Committed/history/repo
Git File States
Files exist in 1 of 4 states
 Untracked, Modified, Staged or Committed
 An untracked file is one that is not currently part of the version controlled
directory
Use git commands for adding, moving, renaming and
removing/deleting files
 git add
 git mv (move and rename)
 git rm (remove)
Intro to Git and Github
Intro to Git and Github
Intro to Git and Github
Intro to Git and Github
Git repo/project data
Git stores 3 copies of a project on your workstation.
 One copy is your own repository with your own commit history.
 The second copy is your working copy where you are editing and building.
 State can be Working or Staged
 The third copy is your local "cached" copy of a remote repository.
Git saves space by storing file contents as unique, compressed blobs
identified by a hash
Git Remotes
Remotes - remote repository (internet or local network or
local)
 Origin - default name for remote cloned from
 Merge Conflicts: local & remote
Commands
 Fetch - get changes from remote, updates remote-tracking branch
 Pull - combination of git fetch & git merge, updates current local branch
 Push - push changes to remote
Git Commands
 init, clone
 add, mv, rm, reset, clean
 checkout, commit
 status, log, show, grep, reflog
 branch, merge, diff, rebase, tag
 fetch, pull, push
 config, remote
Intro to Git and Github
Git Workflows
Central Repository
Dictator and Lieutenant Model
Integration Manager
Git terminology to know
 head - symbolic reference to the branch you’re on. By default, there
is a "head" in every repository called master.
 HEAD - currently active head/branch
 Tags - pointer to a commit (like a label)
 Reset - rewrite history
 Cherry-pick - pick up a specific commit
 Rebase - reorder commits, edit them, squash multiple commits into
one, etc.
 Rebase vs. Merge (historical audit record vs. cleaned up record)
Git Rebase warning:
Do not rebase commits that
exist outside your repository.
GitHub
Github
Online Service/Collaboration Platform
 Core function is an online git service
 Adds: issues, pull requests, code review, orgs & teams, pages, etc.
Enhancements on top of Git
 Fork - copy of another repository (clone)
 Pull Request (PR) – code review & approval step
Github Flow
 Create Branch, Add Commits, Open PR, Discuss & Review, Merge & Deploy
GitHub Flow

More Related Content

PPTX
Branch Management in Git Fusion
ODP
Git vs svn
PDF
Git vs. Mercurial
ODP
Source Code Management systems
PDF
Git vs Subversion: ¿Cuando elegir uno u otro?
PPTX
01 - Git vs SVN
PPTX
From Windows to Linux: Converting a Distributed Perforce Helix Infrastructure
Branch Management in Git Fusion
Git vs svn
Git vs. Mercurial
Source Code Management systems
Git vs Subversion: ¿Cuando elegir uno u otro?
01 - Git vs SVN
From Windows to Linux: Converting a Distributed Perforce Helix Infrastructure

What's hot (18)

PDF
Version control with GIT
PDF
Tutorial: Managing Protected Data with Globus Connect Server v5
PPT
File System On Steroids
PDF
GlobusWorld 2021 Tutorial: The Globus CLI, Platform and SDK
PDF
Making Storage Systems Accessible via Globus (GlobusWorld Tour West)
PDF
Globus Endpoint Setup and Configuration - XSEDE14 Tutorial
PDF
Minerva: Drill Storage Plugin for IPFS
PDF
Collaborative development with Git | Workshop
PDF
Simple Data Automation with Globus (GlobusWorld Tour West)
PDF
Tutorial: Introduction to Globus for System Administrators
PDF
Globus for System Administrators (GlobusWorld Tour - UCSD)
PPTX
Source Control Using Git
PDF
Getting started with git svn
PPTX
Globus for System Administrators
PPT
Introduction to git
PDF
GlobusWorld 2021 Tutorial: Introduction to Globus
PPT
PDF
Introduction to Globus (APS Workshop)
Version control with GIT
Tutorial: Managing Protected Data with Globus Connect Server v5
File System On Steroids
GlobusWorld 2021 Tutorial: The Globus CLI, Platform and SDK
Making Storage Systems Accessible via Globus (GlobusWorld Tour West)
Globus Endpoint Setup and Configuration - XSEDE14 Tutorial
Minerva: Drill Storage Plugin for IPFS
Collaborative development with Git | Workshop
Simple Data Automation with Globus (GlobusWorld Tour West)
Tutorial: Introduction to Globus for System Administrators
Globus for System Administrators (GlobusWorld Tour - UCSD)
Source Control Using Git
Getting started with git svn
Globus for System Administrators
Introduction to git
GlobusWorld 2021 Tutorial: Introduction to Globus
Introduction to Globus (APS Workshop)
Ad

Similar to Intro to Git and Github (20)

PPTX
GIT.pptx
PPTX
Git&GitHub.pptx
PPTX
Git and Github workshop GDSC MLRITM
PPTX
Git Session 2K23.pptx
PDF
Git basics
PPTX
Git and GitHub
PPTX
github ppt git ppt on git hub to know ab
PDF
Git training
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PPTX
Git Basics for Software Version Management
PPTX
Introduction to Git and Github
PPTX
Git and github
PPTX
Git and Github
PPTX
Git Overview
PDF
Git basics
PDF
Git basic introduction & tutorial for begginer
PPTX
PPTX
GITHappens, powerpoint about git and github
PDF
PPT
GIT.pptx
Git&GitHub.pptx
Git and Github workshop GDSC MLRITM
Git Session 2K23.pptx
Git basics
Git and GitHub
github ppt git ppt on git hub to know ab
Git training
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Basics for Software Version Management
Introduction to Git and Github
Git and github
Git and Github
Git Overview
Git basics
Git basic introduction & tutorial for begginer
GITHappens, powerpoint about git and github
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Chapter 3 Spatial Domain Image Processing.pdf
Spectroscopy.pptx food analysis technology
“AI and Expert System Decision Support & Business Intelligence Systems”

Intro to Git and Github

  • 1. Intro to Git and GitHub Boston Code Camp 2018 Andrew Babiec 2018-04-07
  • 3. What is Git? Distributed Version Control System  Version Control System: track changes to source code: who, what, why, when
  • 4. Centralized vs. Distributed Centralized repository Distributed repository
  • 5. Git - Distributed Version Control System Git Repository (repo/project)  Entire collection of files and folders, along with full history Characteristics  Local & offline - Entire timeline/history of changes  Snapshots, not deltas  Changes are always additions File history - snapshots in time called commits
  • 6. Git data structure – Commit, Tree, Blob
  • 8. Git Branches Exist at the repository level  A branch applies to the entire repository  Unlike most centralized version control tools where branches exist inside the repository  Default branch is ‘Master’  Can be local or remote Exceptionally lightweight  Implemented as a pointer to a commit in the graph  Exist only in the local repository until they’re explicitly shared  Encourages feature branching Checkout – switch branch
  • 13. Git Two Stage Commit Working/modified/workspace > Staging (index) > Committed/history/repo
  • 14. Git File States Files exist in 1 of 4 states  Untracked, Modified, Staged or Committed  An untracked file is one that is not currently part of the version controlled directory Use git commands for adding, moving, renaming and removing/deleting files  git add  git mv (move and rename)  git rm (remove)
  • 19. Git repo/project data Git stores 3 copies of a project on your workstation.  One copy is your own repository with your own commit history.  The second copy is your working copy where you are editing and building.  State can be Working or Staged  The third copy is your local "cached" copy of a remote repository. Git saves space by storing file contents as unique, compressed blobs identified by a hash
  • 20. Git Remotes Remotes - remote repository (internet or local network or local)  Origin - default name for remote cloned from  Merge Conflicts: local & remote Commands  Fetch - get changes from remote, updates remote-tracking branch  Pull - combination of git fetch & git merge, updates current local branch  Push - push changes to remote
  • 21. Git Commands  init, clone  add, mv, rm, reset, clean  checkout, commit  status, log, show, grep, reflog  branch, merge, diff, rebase, tag  fetch, pull, push  config, remote
  • 27. Git terminology to know  head - symbolic reference to the branch you’re on. By default, there is a "head" in every repository called master.  HEAD - currently active head/branch  Tags - pointer to a commit (like a label)  Reset - rewrite history  Cherry-pick - pick up a specific commit  Rebase - reorder commits, edit them, squash multiple commits into one, etc.  Rebase vs. Merge (historical audit record vs. cleaned up record)
  • 28. Git Rebase warning: Do not rebase commits that exist outside your repository.
  • 30. Github Online Service/Collaboration Platform  Core function is an online git service  Adds: issues, pull requests, code review, orgs & teams, pages, etc. Enhancements on top of Git  Fork - copy of another repository (clone)  Pull Request (PR) – code review & approval step Github Flow  Create Branch, Add Commits, Open PR, Discuss & Review, Merge & Deploy