SlideShare a Scribd company logo
Initiation to
Mouad.elfakir@gmail.com
Mouad EL Fakir
Why ?
‱ Easy code source management.
‱ Easy project management.
‱ Keep history of modifications (commits).
‱ Branches facilitates parallel tasks.
Version Control Solutions
‱ SCCS (1972)
‱ RCS (1982)
‱ CSV (1990)
‱ SVN (2000)
‱ GIT (2005)
‱ Mercurial (2005)
GIT vs SVN
GIT
‱ Distributed version control system.
‱ Lot of local Repos.
‱ Diff is deltas (fast).
‱ Fast local operations.
‱ Fast remote operations.
‱ Internet connection needed only for push/pull.
SVN
‱ Centralized revision control system.
‱ One central repo.
‱ Diff is files (slow).
‱ Slow local operations.
‱ Slow remote operations.
‱ Depends on internet connections.
‱ Depends on central repo.
GIT vs SVN
GIT vs SVN
GIT
SVN
Repo
Local
Repo
RemoteCommit Push Pull
Repo
RemoteCommit Update
Download & Install GIT
‱ On Windows
https://git-for-windows.github.io/
‱ On Linux / Mac
http://www.alexgirard.com/git-book/commencement/installer-git/
Setting Up a Repository
‱ The git init command creates a new Git repository.
Setting Up a Repository
‱ git clone is primarily used to point to an existing repo and
make a clone or copy of that repo at in a new directory, at
another location.
Setting Up a Repository
‱ The git config command is a convenience function that is
used to set Git configuration values on a global or local
project level.
Saving Changes
‱ The git add command adds a change in the working
directory to the staging area.
Saving Changes
‱ The git stash command takes your uncommitted changes
(both staged and unstaged), saves them away for later use,
and then reverts them from your working copy.
Inspecting a Depository
‱ The git status command displays the state of the
working directory and the staging area.
Inspecting a Depository
‱ The git log command displays committed snapshots. It lets
you list the project history, filter it, and search for specific
changes.
Undoing Changes
‱ The git checkout command serves three distinct functions:
checking out files, checking out commits, and checking out
branches.
Undoing Changes
‱ The git revert command undoes a committed snapshot. But,
instead of removing the commit from the project history, it
generate a new commit that undoes all of the changes
Undoing Changes
‱ git reset is a versatile command with many configurations. It can be
used to remove committed snapshots, although it’s more often used
to undo changes in the staging area and the working directory.
Undoing Changes
‱ The git clean command removes untracked files from
your working directory.
Rewriting History
‱ The git commit --amend command is a convenient way to fix up the
most recent commit. It lets you combine staged changes with the
previous commit instead of committing it as an entirely new
snapshot.
Rewriting History
‱ The git rebase command allows you to easily change a
series of commits, modifying the history of your repository.
You can reorder, edit, or squash commits.
Syncing
‱ The git remote command lets you create, view, and
delete connections to other repositories.
Syncing
‱ The git fetch command imports commits from a
remote repository into your local repo
Syncing
‱ git pull runs git fetch with the given parameters and calls
git merge to merge the retrieved branch heads into the
current branch.
Syncing
‱ Use git push to push commits made on your local
branch to a remote repository.
Branches
‱ Create and checkout branches :
Branches
‱ Merge branch into another branch :
Branches
‱ Rebase branch into another branch to keep a linear
history of commits:
Branches
‱ Report commit from one branch to another branch:
Branches
‱ Remove branches from local and from remote repo:
Tags
‱ Create and remove Tags:
Good Practices
‱ Always sync local branch before push to remote:
Good Practices
‱ Always amend related commits into one commit to
keep a good history:
Good Practices
‱ Always use interactive rebase to rewrite history to
keep it clean (squash commits):
Good Practices
‱ Always create branch for every new features or bug fixing
‱ Always create pull request to merge the branch into master
References
‱ https://www.atlassian.com/git/tutorials
‱ https://help.github.com
‱ https://www.atlassian.com/dam/jcr:8132028b-024f-
4b6b-953e-e68fcce0c5fa/atlassian-git-cheatsheet.pdf
DEMO

More Related Content

PPTX
Git commands
PPTX
Git basics to advance with diagrams
PPTX
Git One Day Training Notes
PDF
Git real slides
PPTX
Git - Basic Crash Course
PDF
git and github
PDF
Learning git
PDF
Github - Git Training Slides: Foundations
Git commands
Git basics to advance with diagrams
Git One Day Training Notes
Git real slides
Git - Basic Crash Course
git and github
Learning git
Github - Git Training Slides: Foundations

What's hot (20)

PDF
Git Tutorial I
PDF
Git and github 101
PDF
Starting with Git & GitHub
PPT
Git basic
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PPT
Git workflows presentation
PPTX
Git n git hub
PDF
Git Series. Episode 3. Git Flow and Github-Flow
PDF
Git and git flow
PDF
Git training v10
PDF
Introduction to GitHub
PPTX
Git Terminologies
 
PDF
Git advanced
PDF
Intro to Git and GitHub
ODP
Git vs svn
PDF
Introduction to Git and GitHub
PPTX
Git in 10 minutes
PPTX
Git 101 for Beginners
PPTX
PDF
Git flow Introduction
Git Tutorial I
Git and github 101
Starting with Git & GitHub
Git basic
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git workflows presentation
Git n git hub
Git Series. Episode 3. Git Flow and Github-Flow
Git and git flow
Git training v10
Introduction to GitHub
Git Terminologies
 
Git advanced
Intro to Git and GitHub
Git vs svn
Introduction to Git and GitHub
Git in 10 minutes
Git 101 for Beginners
Git flow Introduction
Ad

Similar to Git (20)

PDF
Git of every day
PPTX
Git and github
PDF
SVN 2 Git
PPTX
Git and Github
PPSX
Advanced Web Development in PHP - Code Versioning and Branching with Git
PPTX
01 - Git vs SVN
PPT
Git presentation
PPTX
GIT.pptx
PPTX
Learning Basic GIT Cmd
PDF
Git training
PPTX
Git Memento of basic commands
PPTX
Hacktoberfest intro to Git and GitHub
PPTX
Git hub abduallah abu nada
PDF
Atlassian git cheatsheet
PDF
Advanced Git Tutorial
PDF
Collaborative development with Git | Workshop
PPT
Introduction to git
PPTX
An introduction to Git
PPTX
Git walkthrough
PPTX
GIT Training
Git of every day
Git and github
SVN 2 Git
Git and Github
Advanced Web Development in PHP - Code Versioning and Branching with Git
01 - Git vs SVN
Git presentation
GIT.pptx
Learning Basic GIT Cmd
Git training
Git Memento of basic commands
Hacktoberfest intro to Git and GitHub
Git hub abduallah abu nada
Atlassian git cheatsheet
Advanced Git Tutorial
Collaborative development with Git | Workshop
Introduction to git
An introduction to Git
Git walkthrough
GIT Training
Ad

Recently uploaded (20)

PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
history of c programming in notes for students .pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administraation Chapter 3
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Introduction to Artificial Intelligence
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Digital Strategies for Manufacturing Companies
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Reimagine Home Health with the Power of Agentic AI​
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Migrate SBCGlobal Email to Yahoo Easily
PTS Company Brochure 2025 (1).pdf.......
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Navsoft: AI-Powered Business Solutions & Custom Software Development
history of c programming in notes for students .pptx
Odoo Companies in India – Driving Business Transformation.pdf
L1 - Introduction to python Backend.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administraation Chapter 3
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction to Artificial Intelligence
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Wondershare Filmora 15 Crack With Activation Key [2025
Digital Strategies for Manufacturing Companies
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
CHAPTER 2 - PM Management and IT Context
Upgrade and Innovation Strategies for SAP ERP Customers
Reimagine Home Health with the Power of Agentic AI​

Git