SlideShare a Scribd company logo
Version Control with Git & GitHub
Piet Cordemans
Nico De Witte
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Version control manages changes
to a set of code/files over time
Babbel1996
(https://commons.wikimedia.org/wiki/File:Tardis_BBC_Television_Center.jpg),
„Tardis BBC Television Center“, CC BY 2.5
Version control allows
you to jump back and
forth through the
history of a set of
files, even exploring
alternative timelines
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Repository
Centralized Distributed
https://git-scm.com/
Command Line tool
Tell git who you are
> git config --global user.name "Firstname Lastname"
> git config --global user.email "name@example.com"
Set up
Repository
> git init
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Working
Copy
Commit
Each node is called a commit
Who?
When?
Why?
What?
Author: Chuck Norris
Date: Thu Feb 28 15:52:55 2019
Message: Chuck Norris only
tests in production
Added: prod/test
Removed: staging/test
Working Copy Staging area Repository
git add git commit
What is the current state?
> git status
Saving your changes
> git commit -m"describe what is committed in this message"
> git add .
.gitignore
Things you want to ignore
* Build artefacts
* Binaries
* Your mother-in-law
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Could you give me an overview?
> git log
What has changed?
> git diff
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
What if I forgot something to commit?
> git commit --amend
What if I didn't want to stage a file?
> git reset HEAD {{filename}}
What if I want to unmodify a file?
> git checkout --{{filename}}
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Local Remote
Version Control with Git & GitHub
Adding a remote
> git remote add origin https://github.com/pcordemans/ChuckNorrisFacts
Local Remote
Local Remote
Pushing to a remote
> git push origin master
Where was that remote again?
> git remote -v
Cloning a repository
> git clone https://github.com/pcordemans/ChuckNorrisFacts
Local Remote
Retrieving the latest changes
Local Remote
> git pull
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Version Control with Git & GitHub
Let's talk about Markdown
# This is Markdown
We love Git and GitHub
<h1>This is HTML</h1>
<p>We love Git and GitHub</p>
Actually, Markdown is extensively used by GitHub
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
Merge conflict:
Rather sooner than later, you will change
something, somebody has also changed
History is a graph
Branching Merging
master
The master branch
The current branch a.k.a. HEAD
master
HEAD
Jumping from one commit to another
WARNING: don't try to commit changes
master
HEAD
master> git checkout {{hash of the commit}}
Creating a new branch and jumping to it
master> git checkout -b dev
master
HEAD
Before After
master
HEAD dev
Committing to the new branch
dev> git commit -m"this message explains everything"
master
HEAD dev
Fast forwarding the master branch
Before After
master
HEAD dev
masterHEAD
dev
dev> git checkout master
master> git merge dev
Actual branching
master
HEAD devBefore After
master HEAD
dev
dev> git checkout master
master> git commit -m"descriptive message"
Merging
Before After
master HEAD
dev master HEADdev
master> git merge dev
Resolving merge conflicts:
Make a new commit after you figured out
what to keep and what to delete
Forking
GitHub:
source repository
GitHub:
fork
GitHub:
fork
Local
clone
GitHub:
Pull Request
Local
clone
What is Version Control?
Setting up a repository
Saving changes
Looking at history
Undoing changes
Distributing the repository
Structuring text
Collaboration
Beyond GitHub
GitHub is more than hosting remote git repositories
Project management
Collaboration
Education
Integration
Sharing
Security
Integration example
Netlify is website deployment service, which deploys
a website from a repository
https://workshop-iot-programming.devbit.be/git-and-github/
More information
https://git-scm.com/book/en/v2
https://www.atlassian.com/git/tutorials
IoT-Incubator.be
Research - Prototyping - Training
Contact us Research and education | Internet of Things
VIVES University of Applied Sciences | Industrial Sciences and Technology
Spoorwegstraat 12 | 8200 Brugge | BELGIUM
piet.cordemans@vives.be | IoT-Incubator.be
LoRa Academy
Internet of Things: Mbed
Cisco Academy
o CCNA
o Cybersecurity Operations
Ethical hacking
Training courses
App development
o NativeScript
o Node.js
DevOps
Wireshark
https://www.vives.be/nl/navormingen-ict

More Related Content

PDF
Advanced Git Tutorial
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
PPTX
PPTX
Git and github
PPTX
Overview of github
PPTX
Basic Git Intro
PDF
Les bases de git
PDF
Git and git flow
Advanced Git Tutorial
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and github
Overview of github
Basic Git Intro
Les bases de git
Git and git flow

What's hot (20)

PPTX
Git and Github Session
PPTX
Git One Day Training Notes
PDF
Git - An Introduction
PPT
Introduction to Git and Github
PDF
Git real slides
PPTX
Git and GitHub
PPTX
Git 101
PDF
Git training v10
PDF
git and github
PPTX
Introduction to Gitlab | Gitlab 101 | Training Session
KEY
The everyday developer's guide to version control with Git
PDF
Learning git
PDF
Introducing GitLab (June 2018)
PPTX
Git - Basic Crash Course
PPT
Git workflows
PDF
Use o git e perca o medo de errar
PPTX
A prentation on github
PDF
Introduction to Git
PDF
Advanced Git
Git and Github Session
Git One Day Training Notes
Git - An Introduction
Introduction to Git and Github
Git real slides
Git and GitHub
Git 101
Git training v10
git and github
Introduction to Gitlab | Gitlab 101 | Training Session
The everyday developer's guide to version control with Git
Learning git
Introducing GitLab (June 2018)
Git - Basic Crash Course
Git workflows
Use o git e perca o medo de errar
A prentation on github
Introduction to Git
Advanced Git
Ad

Similar to Version Control with Git & GitHub (20)

PDF
Git and GitHub Info Session
PDF
Version control with Git & GitHub
PPTX
Introduction to git & GitHub
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PDF
Git Version Control for the Complete N00b by Adam LaBarge
PPTX
Mini-training: Let’s Git It!
PDF
Starting with Git & GitHub
PDF
O365Con18 - Git and GitHub - Rick van Rousselt
PDF
Git and Github - A primer
PPTX
Version controll.pptx
PDF
Version Control with Git
PPTX
Version Control with Git
PPTX
github_gyan.pptx
PPTX
Git.pptx
PPTX
Git&GitHub.pptx
PDF
Git introduction for Beginners
PPTX
git and github-1.pptx
PDF
The Basics of Open Source Collaboration With Git and GitHub
Git and GitHub Info Session
Version control with Git & GitHub
Introduction to git & GitHub
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Version Control for the Complete N00b by Adam LaBarge
Mini-training: Let’s Git It!
Starting with Git & GitHub
O365Con18 - Git and GitHub - Rick van Rousselt
Git and Github - A primer
Version controll.pptx
Version Control with Git
Version Control with Git
github_gyan.pptx
Git.pptx
Git&GitHub.pptx
Git introduction for Beginners
git and github-1.pptx
The Basics of Open Source Collaboration With Git and GitHub
Ad

Recently uploaded (20)

PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Essential Infomation Tech presentation.pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
top salesforce developer skills in 2025.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
System and Network Administraation Chapter 3
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
ai tools demonstartion for schools and inter college
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Understanding Forklifts - TECH EHS Solution
Essential Infomation Tech presentation.pptx
Design an Analysis of Algorithms II-SECS-1021-03
top salesforce developer skills in 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
2025 Textile ERP Trends: SAP, Odoo & Oracle
System and Network Administraation Chapter 3
Navsoft: AI-Powered Business Solutions & Custom Software Development
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
How Creative Agencies Leverage Project Management Software.pdf
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Choose the Right IT Partner for Your Business in Malaysia
ai tools demonstartion for schools and inter college
Operating system designcfffgfgggggggvggggggggg
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
VVF-Customer-Presentation2025-Ver1.9.pptx

Version Control with Git & GitHub