KEMBAR78
Mastering Version Control with Git & GitHub | PDF
Version Control and
Workflow 16-10-2025
Who am I ?
• Data Scientist
• Research Master's Student, Faculty
of Science of Sfax (FSS)
Plan
Part 1 — Theoretical Foundations
Part 2 — Practical Session
A
Part 1 — Theoretical Foundations
1
A
Part 1 — Theoretical Foundations
B
Modification
2
A
Part 1 — Theoretical Foundations
B
Saved
3
A
Part 1 — Theoretical Foundations
B
How to keep the 2 versions?
4
Bad solutions
Part 1 — Theoretical Foundations
5
Problematic
Part 1 — Theoretical Foundations
How to manage files versions
effectively?
6
Version Control
• System that tracks every change made to your
codebase.
Part 1 — Theoretical Foundations
• Allows developers to revert, compare, and
collaborate safely.
7
Why Every Developer Needs
It?
Keeps a complete history of your project
Part 1 — Theoretical Foundations
8
Why Every Developer Needs
It?
Allows experimentation without fear of breaking the main code
Part 1 — Theoretical Foundations
9
Benefits for Teams and Open
Source
• Teams can work in parallel on different features.
Part 1 — Theoretical Foundations
• Merge and review changes without overwriting others.
10
Benefits for Teams and Open
Source
• Enables open-source collaboration
• Supports automation and DevOps pipelines.
Part 1 — Theoretical Foundations
11
DevOps
DevOps is a set of practices that combines software development (Dev) and IT operations (Ops) to
shorten the systems development life cycle and provide continuous delivery with high software
Part 1 — Theoretical Foundations
12
Part 1 — Theoretical Foundations
Git
• Git = Distributed Version Control System (DVCS)
• Manages snapshots of the project
• Each developer has a full local history
13
Part 1 — Theoretical Foundations
Git architecture
• Working Directory:
• Staging Area (Index):
• Local Repository:
• Remote Repository:
Where you make changes
Prepares changes for commit
Stores confirmed commits
Shared version on GitHub
14
Part 1 — Theoretical Foundations
Key Concepts• Commit
• Branch
• Merge
15
Concept Description
Repository Project folder tracked by Git
Commit Snapshot of your code at a specific time
Branch Independent line of development
Merge Combine changes between branches
Remote A hosted version of your repo (e.g., GitHub)
Part 1 — Theoretical Foundations
Github
• Web-based hosting for Git repositories
that provides version control and
collaboration features.
“Git tracks code. GitHub connects people.”
16
Part 1 — Theoretical Foundations
Core Features
• Repositories: Store and version your code
• Forks: Copy someone’s repo to make your own
changes
• Pull Requests (PRs): Propose changes to a
project
17
Part 2 — Practical Session
Objective of the workshop
• Push a file or a project to a distant repository
• Fork and clone an existing project
18
Part 2 — Practical Session
Steps:
Install Git
https://git-scm.com/downloads
19
Part 2 — Practical Session
Steps:
Create a GitHub account and try to create an
empty project
20
Part 2 — Practical Session
Steps:
• Create a folder named “workshop”
• Under it, create a text file “test.txt”
21
Part 2 — Practical Session
Steps:
Open cmd/power_shell/git_bash(CLI) under
the folder “workshop”
22
Part 2 — Practical Session
Steps:
Initialize a git repository:
git init
23
Part 2 — Practical Session
Steps:
Providing information about the current state
of your repository:
git status
24
Part 2 — Practical Session
Steps:
Staging your files to make them ready to
commit:
git add .
25
Part 2 — Practical Session
Steps:
Author authentication:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
26
Part 2 — Practical Session
Steps:
Commit your files with a comment:
git commit -m "first commit"
27
Part 2 — Practical Session
Steps:
Visualize your commits:
• ID of a commit
• A comment
• Author information (email-name...)
• Creation date 28
Part 2 — Practical Session
Steps:
Visualize your commits:
git log
29
Part 2 — Practical Session
Steps:
Create a new branch to work on:
git branch "new_branch_name"
30
Part 2 — Practical Session
Steps:
Reallocate to the new branch:
git checkout "new_branch_name"
31
Part 2 — Practical Session
Steps:
Create a text file (feature.txt) in your repo and
make some modifications on it
32
Part 2 — Practical Session
Steps:
We repeat same process:
git add .
git commit -m "add feature"
33
Part 2 — Practical Session
Steps:
Return to the principal branch
git checkout master
34
Part 2 — Practical Session
Steps:
Merge the new branch to the master:
git merge "new_branch-name"
35
Part 2 — Practical Session
Steps:
Remote to the distant repository:
git remote add origin "link"
36
Part 2 — Practical Session
Steps:
Push your files to the distant repo:
git push -u origin master
37
Part 2 — Practical Session
Fork and clone
Fork repository then clone it using:
git clone "link"
38
Part 2 — Practical Session
Next Step
• Explore more Git-GitHub
• Try other web-based hosting for Git
repositories: GitLab, DagsHub...
39
Thank you for
your attention
Get in touch

Mastering Version Control with Git & GitHub

  • 1.
  • 2.
    Who am I? • Data Scientist • Research Master's Student, Faculty of Science of Sfax (FSS)
  • 3.
    Plan Part 1 —Theoretical Foundations Part 2 — Practical Session
  • 4.
    A Part 1 —Theoretical Foundations 1
  • 5.
    A Part 1 —Theoretical Foundations B Modification 2
  • 6.
    A Part 1 —Theoretical Foundations B Saved 3
  • 7.
    A Part 1 —Theoretical Foundations B How to keep the 2 versions? 4
  • 8.
    Bad solutions Part 1— Theoretical Foundations 5
  • 9.
    Problematic Part 1 —Theoretical Foundations How to manage files versions effectively? 6
  • 10.
    Version Control • Systemthat tracks every change made to your codebase. Part 1 — Theoretical Foundations • Allows developers to revert, compare, and collaborate safely. 7
  • 11.
    Why Every DeveloperNeeds It? Keeps a complete history of your project Part 1 — Theoretical Foundations 8
  • 12.
    Why Every DeveloperNeeds It? Allows experimentation without fear of breaking the main code Part 1 — Theoretical Foundations 9
  • 13.
    Benefits for Teamsand Open Source • Teams can work in parallel on different features. Part 1 — Theoretical Foundations • Merge and review changes without overwriting others. 10
  • 14.
    Benefits for Teamsand Open Source • Enables open-source collaboration • Supports automation and DevOps pipelines. Part 1 — Theoretical Foundations 11
  • 15.
    DevOps DevOps is aset of practices that combines software development (Dev) and IT operations (Ops) to shorten the systems development life cycle and provide continuous delivery with high software Part 1 — Theoretical Foundations 12
  • 16.
    Part 1 —Theoretical Foundations Git • Git = Distributed Version Control System (DVCS) • Manages snapshots of the project • Each developer has a full local history 13
  • 17.
    Part 1 —Theoretical Foundations Git architecture • Working Directory: • Staging Area (Index): • Local Repository: • Remote Repository: Where you make changes Prepares changes for commit Stores confirmed commits Shared version on GitHub 14
  • 18.
    Part 1 —Theoretical Foundations Key Concepts• Commit • Branch • Merge 15 Concept Description Repository Project folder tracked by Git Commit Snapshot of your code at a specific time Branch Independent line of development Merge Combine changes between branches Remote A hosted version of your repo (e.g., GitHub)
  • 19.
    Part 1 —Theoretical Foundations Github • Web-based hosting for Git repositories that provides version control and collaboration features. “Git tracks code. GitHub connects people.” 16
  • 20.
    Part 1 —Theoretical Foundations Core Features • Repositories: Store and version your code • Forks: Copy someone’s repo to make your own changes • Pull Requests (PRs): Propose changes to a project 17
  • 21.
    Part 2 —Practical Session Objective of the workshop • Push a file or a project to a distant repository • Fork and clone an existing project 18
  • 22.
    Part 2 —Practical Session Steps: Install Git https://git-scm.com/downloads 19
  • 23.
    Part 2 —Practical Session Steps: Create a GitHub account and try to create an empty project 20
  • 24.
    Part 2 —Practical Session Steps: • Create a folder named “workshop” • Under it, create a text file “test.txt” 21
  • 25.
    Part 2 —Practical Session Steps: Open cmd/power_shell/git_bash(CLI) under the folder “workshop” 22
  • 26.
    Part 2 —Practical Session Steps: Initialize a git repository: git init 23
  • 27.
    Part 2 —Practical Session Steps: Providing information about the current state of your repository: git status 24
  • 28.
    Part 2 —Practical Session Steps: Staging your files to make them ready to commit: git add . 25
  • 29.
    Part 2 —Practical Session Steps: Author authentication: git config --global user.email "you@example.com" git config --global user.name "Your Name" 26
  • 30.
    Part 2 —Practical Session Steps: Commit your files with a comment: git commit -m "first commit" 27
  • 31.
    Part 2 —Practical Session Steps: Visualize your commits: • ID of a commit • A comment • Author information (email-name...) • Creation date 28
  • 32.
    Part 2 —Practical Session Steps: Visualize your commits: git log 29
  • 33.
    Part 2 —Practical Session Steps: Create a new branch to work on: git branch "new_branch_name" 30
  • 34.
    Part 2 —Practical Session Steps: Reallocate to the new branch: git checkout "new_branch_name" 31
  • 35.
    Part 2 —Practical Session Steps: Create a text file (feature.txt) in your repo and make some modifications on it 32
  • 36.
    Part 2 —Practical Session Steps: We repeat same process: git add . git commit -m "add feature" 33
  • 37.
    Part 2 —Practical Session Steps: Return to the principal branch git checkout master 34
  • 38.
    Part 2 —Practical Session Steps: Merge the new branch to the master: git merge "new_branch-name" 35
  • 39.
    Part 2 —Practical Session Steps: Remote to the distant repository: git remote add origin "link" 36
  • 40.
    Part 2 —Practical Session Steps: Push your files to the distant repo: git push -u origin master 37
  • 41.
    Part 2 —Practical Session Fork and clone Fork repository then clone it using: git clone "link" 38
  • 42.
    Part 2 —Practical Session Next Step • Explore more Git-GitHub • Try other web-based hosting for Git repositories: GitLab, DagsHub... 39
  • 43.
    Thank you for yourattention Get in touch