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
Ad

More Related Content

What's hot (20)

git and github
git and githubgit and github
git and github
Darren Oakley
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
Safique Ahmed Faruque
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Yan Vugenfirer
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Bitbucket and Git
Bitbucket and GitBitbucket and Git
Bitbucket and Git
Mohit Shukla
 

Similar to Git (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
Haitham Raik
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
Serhii Kartashov
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Sameera Wijesekara
 
Git presentation
Git presentationGit presentation
Git presentation
Sai Kumar Satapathy
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
 
Version Control System-git status,git add,git commit,git log.pptx
Version Control System-git status,git add,git commit,git log.pptxVersion Control System-git status,git add,git commit,git log.pptx
Version Control System-git status,git add,git commit,git log.pptx
ChayapathiAR
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
Pablo Quiroga
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
Pablo Quiroga
 
git Technologies
git Technologiesgit Technologies
git Technologies
Hirantha Pradeep
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
Gourav Varma
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
Chris Ballance
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
MohanRaviRohitth
 
Talk to git
Talk to gitTalk to git
Talk to git
YenTing Chen
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
Bimal Jain
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
gdsc13
 
Git 101
Git 101Git 101
Git 101
Sachet Mittal
 
git.ppt.pptx power point presentation got Google internet
git.ppt.pptx power point presentation got Google internetgit.ppt.pptx power point presentation got Google internet
git.ppt.pptx power point presentation got Google internet
rani marri
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Version Control System-git status,git add,git commit,git log.pptx
Version Control System-git status,git add,git commit,git log.pptxVersion Control System-git status,git add,git commit,git log.pptx
Version Control System-git status,git add,git commit,git log.pptx
ChayapathiAR
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
Gourav Varma
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
Bimal Jain
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
gdsc13
 
git.ppt.pptx power point presentation got Google internet
git.ppt.pptx power point presentation got Google internetgit.ppt.pptx power point presentation got Google internet
git.ppt.pptx power point presentation got Google internet
rani marri
 
Ad

Recently uploaded (20)

Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Ad

Git