SlideShare a Scribd company logo
GIT Ready
introduction to git and github
Day 1
Who am I ?
● Mosaab Ehab elsayed
● 3rd year student at faculty of engineering
● CSED
● python Web developer with django
● web circle member at CATReloaded
● marketer at IEEEMansB
● good learner seek to be the teacher
Sad Story ….
Git session day 1
Git session day 1
Git session day 1
Git session day 1
Git session day 1
Git session day 1
Version control
also known as revision control
or source control,
is the management of changes to
documents, computer programs,
large web sites, and other
collections of information.
https://goo.gl/e43hnH
Version control Systems
Version control systems are a
category of software tools that help
a software team manage changes to
source code over time.
Version control software
keeps track of every modification to
the code in a special kind of
database.
https://goo.gl/xEkRsa
Version control examples
Git session day 1
Git session day 1
Git session day 1
Any
Editor
use
offline
manual
saving
Any
Editor
use
offline
manual
saving
Manual Saving yes yes yes
Any
Editor
use
offline
manual
saving
Manual Saving yes yes yes
Dropbox yes no no
Any
Editor
use
offline
manual
saving
Manual Saving yes yes yes
Dropbox yes no no
Google Docs no no no
Any
Editor
use
offline
manual
saving
Manual Saving yes yes yes
Dropbox yes no no
Google Docs no no no
Wikipedia no no yes
Version control Systems
● CVS
● SVN
● Mercurial (hg)
● Git
GIT
a version control system for tracking
changes in computer files and
coordinating work on those files
among multiple people. It is primarily
used for source code management in
software development,but it can be
used to keep track of changes in any
set of files
https://goo.gl/xEkRsa
Any
Editor
use
offline
manual
saving
Manual Saving yes yes yes
Dropbox yes no no
Google Docs no no no
Wikipedia no no yes
Git yes yes yes
Installing Git
Git session day 1
Windows
Ubuntu
$ sudo apt-get update
$ sudo apt-get install git
Configure your environment
Username and Email
$ git config --global user.name “your name”
$ git config --global user.email “your email”
Commits
https://goo.gl/Pivmfx
commit with multiple files
index.html
commit with multiple files
index.html
game.js
commit with multiple files
index.html
game.js
main.css
commit with multiple files
index.html
game.js
main.css
index.html
commit with multiple files
index.html
game.js
main.css
index.html index.html
commit with multiple files
index.html
game.js
main.css
index.html index.html index.html
commit with multiple files
index.html
game.js
main.css
index.html index.html index.html
game.js
main.css
game.js
main.css
game.js
main.css
commit with multiple files
index.html
game.js
main.css
index.html index.html index.html
game.js
main.css
game.js
main.css
game.js
main.css
commit
What makes a repo a repo ?
Git session day 1
Git session day 1
GUI Vs Command line
Git session day 1
https://goo.gl/HqxcVP
Git session day 1
Git session day 1
Initialize your first repo ...
Initialization
$ git init
git commit -m “add my first commit”
our first commit
$ git add “file name”
$ git commit -m “your message”
Staging area
Working directory
index.html
game.js
main.css
Working directory
index.html
game.js
main.css
Working directory Repository
index.html
game.js
main.css
Working directory
index.html
game.js
main.css
Repository
Commit
Commit
Commit
index.html
game.js
main.css
Working directory Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
index.html
game.js
main.css
Working directory
index.html
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git add “file”
index.html
game.js
main.css
Working directory
index.html
game.js
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git add “file”
index.html
game.js
main.css
Working directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git add “file”
index.html
game.js
main.css
Working directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git add “file” git commit
Display your commits
Display commits
$ git log
$ git log --pretty=oneline
Step back
Step back
$ git reset --hard
or
$ git checkout <commit_id>
git reset
Discard any changes in
either the working directory
or the staging area
index.html
game.js
main.css
Working directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git reset --hard
Branch your master
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: ,
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
commit: .
author : ..
parent : ..
size: ….
Master
Branching
$ git branch <branch_name>
move to the new branch
$ git checkout <branch_name>
two steps in one
$ git branch <branch_name>
+
$ git checkout <branch_name>
=
$ git checkout -b <branch_name>
display your paths
$ git log --graph --oneline <branch_name> <another_branch>
Merge some branches
display your paths
$ git merge <branch_name> <other_branch>
$ git commit -m “merge branches”
delete branch
$ git branch -d <branch_name>
solve the conflicts between branches
Git session day 1
Show your diffs
show your difs
$ git diff
$ git diff <id1> <id2>
$ git diff --staged
index.html
game.js
main.css
Working
directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
index.html
game.js
main.css
Working
directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git diff
index.html
game.js
main.css
Working
directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git diff
git diff <id> <id>
index.html
game.js
main.css
Working
directory
index.html
game.js
main.css
Staging Area
index.html
game.js
main.css
Repository
Commit
Commit
Commit
git diff git diff --staged
git diff <id> <id>
Git some help
Git some help
$ git help
$ git help <aspect>
Any questions ?
Thank you :”)
see you soon :”D

More Related Content

PDF
Git session day 2
PDF
A Quick Start - Version Control with Git
KEY
Git Basics - RubyFest 2009
PDF
Go, the one language to learn in 2014
ODP
Eat my data
PDF
PDF
GIT: Content-addressable filesystem and Version Control System
Git session day 2
A Quick Start - Version Control with Git
Git Basics - RubyFest 2009
Go, the one language to learn in 2014
Eat my data
GIT: Content-addressable filesystem and Version Control System

What's hot (19)

PDF
Introducing gitfs
PDF
Tài liệu sử dụng GitHub
PDF
Git cheat-sheet
PDF
Git Real
PPTX
Quick and easy way to get started with Git & GitHub
KEY
Git Distributed Version Control System
PDF
Collaborative Coding: Git + Github (NSI Tech Talks)
PDF
Deep dark-side of git: How git works internally
PPTX
Working in Team using Git in Unity
PPT
Collaboration With Git and GitHub
PDF
Git 101 Workshop
PDF
Git in 5 Minutes
KEY
Git - Some tips to do it better
PPTX
Git operation 101
PDF
Git training
PDF
DO YOU WANT TO USE A VCS
PDF
[로켓 자바] Part 1 성능 튜닝 마인드 확립
PDF
How to become a Git power user
PDF
とりあえずはじめるChatOps
Introducing gitfs
Tài liệu sử dụng GitHub
Git cheat-sheet
Git Real
Quick and easy way to get started with Git & GitHub
Git Distributed Version Control System
Collaborative Coding: Git + Github (NSI Tech Talks)
Deep dark-side of git: How git works internally
Working in Team using Git in Unity
Collaboration With Git and GitHub
Git 101 Workshop
Git in 5 Minutes
Git - Some tips to do it better
Git operation 101
Git training
DO YOU WANT TO USE A VCS
[로켓 자바] Part 1 성능 튜닝 마인드 확립
How to become a Git power user
とりあえずはじめるChatOps
Ad

Similar to Git session day 1 (20)

PPTX
Git and Github
PPTX
Git and github
PDF
Advanced Git Tutorial
PPTX
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
PPTX
Git_new.pptx
PPTX
Git walkthrough
PDF
Git basics
PPTX
Git and GitHub
PPTX
Git 101 - An introduction to Version Control using Git
PDF
Git basics
PPTX
Intro to git and git hub
PPT
Fundamentals and basics of Git and commands
PDF
Git Init (Introduction to Git)
PPTX
An introduction to Git
PPTX
GIT.pptx
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
PPTX
Git basic stanley hsiao 2010_12_15
PDF
Git training v10
PDF
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git and Github
Git and github
Advanced Git Tutorial
Let's Git this Party Started: An Introduction to Git and GitHub
Git_new.pptx
Git walkthrough
Git basics
Git and GitHub
Git 101 - An introduction to Version Control using Git
Git basics
Intro to git and git hub
Fundamentals and basics of Git and commands
Git Init (Introduction to Git)
An introduction to Git
GIT.pptx
Getting Started with Git: A Primer for SVN and TFS Users
Git basic stanley hsiao 2010_12_15
Git training v10
Git Tutorial A Comprehensive Guide for Beginners.pdf
Ad

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
sap open course for s4hana steps from ECC to s4
PDF
KodekX | Application Modernization Development
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectroscopy.pptx food analysis technology
Empathic Computing: Creating Shared Understanding
Programs and apps: productivity, graphics, security and other tools
sap open course for s4hana steps from ECC to s4
KodekX | Application Modernization Development
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Git session day 1