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

What's hot

Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
 
Git and github
Git and githubGit and github
Git and github
Sayantika Banik
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
Dilum Navanjana
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
Emanuele Olivetti
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
Carl Brown
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
Yash
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
James Gray
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Git
GitGit
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 

What's hot (20)

Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git and github
Git and githubGit and github
Git and github
 
Git basics
Git basicsGit basics
Git basics
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git
GitGit
Git
 
Github basics
Github basicsGithub basics
Github basics
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 

Similar to Git

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
 
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
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
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 Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 

Similar to Git (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
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
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git presentation
Git presentationGit presentation
Git presentation
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git basic
Git basicGit basic
Git basic
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Git 101
Git 101Git 101
Git 101
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 

Recently uploaded

Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
seospiralmantra
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 

Recently uploaded (20)

Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
DevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps ServicesDevOps Consulting Company | Hire DevOps Services
DevOps Consulting Company | Hire DevOps Services
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 

Git