SlideShare a Scribd company logo
Fundamentals of Git
By Chris McKnight
March 26th, 2015
Overview
• History of Git
• Project setup
• Staging Changes and Committing
• Branching, Merging, and Rebasing
• Working with remotes
History of Git
• Linux kernel developers started using
BitKeeper1
• BitKeeper license revoked
• Linus Torvalds created Git in 2005
1http://git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git
What is Git?
• Distributed revision control system
• Goals
• Efficiency
• Speed
• Non-linear workflows
Configure Git
• Install Git1
• Configure user settings
• git config --global user.name “John Doe”
• git config --global user.email
“jdoe@example.com”
• Configure line ending conversions (OS
dependent)2
1https://help.github.com/articles/set-up-git
2https://help.github.com/articles/dealing-with-line-endings
Project Setup
• New Project
• init
• Create a .gitignore file
• Create a .gitattributes file
(optional)
• stage changes
• commit
• Existing project (not on computer)
• clone from a remote
Staging Changes &
Committing
• Staging changes
• git add <path>
• git rm <path>
• git commit
• Unstage changes
• git reset
• Can also move the file pointer
of the current branch or
discard all changes using git
reset
Branching
• Default branch is called
master
• Lightweight pointer to a
commit
• Useful for work in
progress, features, and
bug fixes
Merging
• Integrates changes from one
branch to another
• Example: merging a feature
branch into master for
deployment
Rebasing
• Another method of integrating changes of a
branch into another branch
• Rewrites history
• Moves to common ancestor of the two
rebased branches
• Figures out diffs
• Moves commits from the current branch into
a temporary area
• Resets the current branch to the branch you
are rebasing from
• Applies commits from the temporary area
onto the current branch
• Usage
• Updating a feature branch with bugfix
changes
• Cleaning up a local feature branch before
pushing to a remote
Remotes
• Typically the main remote is named origin
• origin is not a special remote
• can have multiple remotes
• Another Git repository used for
collaboration
• Changes are pushed and pulled
A basic workflow
• Create a new project
• Stage files and commit
• Create a remote and push
• Iterative development by using branches,
merging and pushing changes
GUI Tools
• Sourcetree GUI (http://www.sourcetreeapp.com/)
• GitHub app
• https://windows.github.com
• https://mac.github.com
• Others available at http://git-scm.com/download/
gui/linux
Diff & Merge Tools
• Kaleidoscope for Mac (http://
www.kaleidoscopeapp.com)
• WinMerge for Windows (http://winmerge.org)
• Meld for Windows (http://meldmerge.org)
• Araxis Merge (http://www.araxis.com/merge)
Resources
• Pro Git Book (http://git-scm.com/book/en/v2)
• GitHub (https://help.github.com)
• Try Git (https://www.codeschool.com/courses/
try-git)
• Git Real (https://www.codeschool.com/courses/
git-real and https://www.codeschool.com/
courses/git-real-2)

More Related Content

PPTX
Git overview
PPTX
Git theory
PPTX
Introduction to git hub
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
PPTX
Git n git hub
PPTX
Git tutorial git branches 20131206-Bryan
PPTX
Git and github fundamentals
PPTX
Introduction to git
Git overview
Git theory
Introduction to git hub
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git n git hub
Git tutorial git branches 20131206-Bryan
Git and github fundamentals
Introduction to git

What's hot (20)

PPTX
Git with bitbucket
PPTX
Version control git day03
PDF
Git and GitHub workflows
PDF
Git ops: Git based application deployment patterns for Kubernetes
PDF
GitOps with Gitkube
PPTX
Workshop on Git and GitHub
PPTX
HacktoberFest-Git&GitHub
PPTX
Introduction to Git and Github
PDF
Know the Science behind WorkFlows using Git & GitHhub
PDF
Git简介
PPTX
Learn Git - For Beginners and Intermediate levels
PPTX
PPTX
Git and Github Session
PPTX
Using Git and BitBucket
PDF
Introduction to Git
PDF
A Practical Introduction to git
PPTX
Bitbucket
PPTX
Version control git day03
Git with bitbucket
Version control git day03
Git and GitHub workflows
Git ops: Git based application deployment patterns for Kubernetes
GitOps with Gitkube
Workshop on Git and GitHub
HacktoberFest-Git&GitHub
Introduction to Git and Github
Know the Science behind WorkFlows using Git & GitHhub
Git简介
Learn Git - For Beginners and Intermediate levels
Git and Github Session
Using Git and BitBucket
Introduction to Git
A Practical Introduction to git
Bitbucket
Version control git day03
Ad

Similar to Fundamentals of Git (20)

PDF
Git 101: Git and GitHub for Beginners
PDF
The Basics of Open Source Collaboration With Git and GitHub
PDF
Git Workflow
PPTX
GitHub_For_Beginners_Presentationss.pptx
PDF
Git for folk who like GUIs
ZIP
Beginner's Guide to Version Control with Git
PPT
Git installation and configuration
PPTX
Git and Github and how can we leverage in Daily Coding
PPT
Introduction to git
PPTX
Version Control System-git status,git add,git commit,git log.pptx
PPTX
Git One Day Training Notes
PPTX
git Technologies
PPTX
Git and github
PDF
Git Tutorial I
PPTX
Bekerja dengan git v2 materi untuk kelas RPL
PPTX
Make Git Understand Excel Workbooks - Eusprig 2018
PPTX
11 git version control
PDF
Introduction to git
PDF
ePOM - Fundamentals of Research Software Development - Code Version Control
PPTX
GIT In Detail
Git 101: Git and GitHub for Beginners
The Basics of Open Source Collaboration With Git and GitHub
Git Workflow
GitHub_For_Beginners_Presentationss.pptx
Git for folk who like GUIs
Beginner's Guide to Version Control with Git
Git installation and configuration
Git and Github and how can we leverage in Daily Coding
Introduction to git
Version Control System-git status,git add,git commit,git log.pptx
Git One Day Training Notes
git Technologies
Git and github
Git Tutorial I
Bekerja dengan git v2 materi untuk kelas RPL
Make Git Understand Excel Workbooks - Eusprig 2018
11 git version control
Introduction to git
ePOM - Fundamentals of Research Software Development - Code Version Control
GIT In Detail
Ad

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administration Chapter 2
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
medical staffing services at VALiNTRY
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Nekopoi APK 2025 free lastest update
PPTX
L1 - Introduction to python Backend.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administration Chapter 2
How to Migrate SBCGlobal Email to Yahoo Easily
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
CHAPTER 2 - PM Management and IT Context
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
Understanding Forklifts - TECH EHS Solution
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
medical staffing services at VALiNTRY
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Nekopoi APK 2025 free lastest update
L1 - Introduction to python Backend.pptx

Fundamentals of Git

  • 1. Fundamentals of Git By Chris McKnight March 26th, 2015
  • 2. Overview • History of Git • Project setup • Staging Changes and Committing • Branching, Merging, and Rebasing • Working with remotes
  • 3. History of Git • Linux kernel developers started using BitKeeper1 • BitKeeper license revoked • Linus Torvalds created Git in 2005 1http://git-scm.com/book/en/v2/Getting-Started-A-Short-History-of-Git
  • 4. What is Git? • Distributed revision control system • Goals • Efficiency • Speed • Non-linear workflows
  • 5. Configure Git • Install Git1 • Configure user settings • git config --global user.name “John Doe” • git config --global user.email “jdoe@example.com” • Configure line ending conversions (OS dependent)2 1https://help.github.com/articles/set-up-git 2https://help.github.com/articles/dealing-with-line-endings
  • 6. Project Setup • New Project • init • Create a .gitignore file • Create a .gitattributes file (optional) • stage changes • commit • Existing project (not on computer) • clone from a remote
  • 7. Staging Changes & Committing • Staging changes • git add <path> • git rm <path> • git commit • Unstage changes • git reset • Can also move the file pointer of the current branch or discard all changes using git reset
  • 8. Branching • Default branch is called master • Lightweight pointer to a commit • Useful for work in progress, features, and bug fixes
  • 9. Merging • Integrates changes from one branch to another • Example: merging a feature branch into master for deployment
  • 10. Rebasing • Another method of integrating changes of a branch into another branch • Rewrites history • Moves to common ancestor of the two rebased branches • Figures out diffs • Moves commits from the current branch into a temporary area • Resets the current branch to the branch you are rebasing from • Applies commits from the temporary area onto the current branch • Usage • Updating a feature branch with bugfix changes • Cleaning up a local feature branch before pushing to a remote
  • 11. Remotes • Typically the main remote is named origin • origin is not a special remote • can have multiple remotes • Another Git repository used for collaboration • Changes are pushed and pulled
  • 12. A basic workflow • Create a new project • Stage files and commit • Create a remote and push • Iterative development by using branches, merging and pushing changes
  • 13. GUI Tools • Sourcetree GUI (http://www.sourcetreeapp.com/) • GitHub app • https://windows.github.com • https://mac.github.com • Others available at http://git-scm.com/download/ gui/linux
  • 14. Diff & Merge Tools • Kaleidoscope for Mac (http:// www.kaleidoscopeapp.com) • WinMerge for Windows (http://winmerge.org) • Meld for Windows (http://meldmerge.org) • Araxis Merge (http://www.araxis.com/merge)
  • 15. Resources • Pro Git Book (http://git-scm.com/book/en/v2) • GitHub (https://help.github.com) • Try Git (https://www.codeschool.com/courses/ try-git) • Git Real (https://www.codeschool.com/courses/ git-real and https://www.codeschool.com/ courses/git-real-2)