SlideShare a Scribd company logo
@ssaunier
git & GitHub
for Beginners
Knowledge worker
We create and edit documents (text, images, etc.)
Everyday workflow
1. Create a file
2. Save it
3. Edit it
4. Save it again
5. etc.
File life
Manual version control
Can we automate this?
For each document version, we need to know
1. When the file was modified
2. What changed
3. Why it was modified
There’s more, teams
Hence one more question
For each document version, we need to know
1. When the file was modified
2. What changed
3. Why it was modified
4. Who did the change
In a nutshell
We want a tool which
1. tracks document version
2. keeps an history of document changes
3. foster team work
Git & GitHub for Beginners
Set up
Download & install git at http://git-scm.com/
Your identity
$ git config --global user.name "Sebastien Saunier”
$ git config --global user.email "seb@lewagon.org"
Basic commands
Starting
$ mkdir new_project
$ cd new_project
$ git init
Status
$ git status
git can tell you if your folder has some modified files (dirty)
Commit
2-steps process
# Select which file to add to the commit.
$ git add <file_1_which_has_been_modified>
$ git add <file_2_which_has_been_modified>
# Take a snapshot of what is in the staging area.
$ git commit --message "A meaningful message about this change"
Diff
If git status tells you something changed,
you can inspect exactly what changed:
$ git diff
$ git diff <a_specific_file_or_folder>
Log
Show commit history with
$ git log
Branching
One feature = One branch
Branch
$ git branch my-feature
Working in the Branch
$ git checkout my-feature
$ git commit (x2)
Merge
$ git checkout master
$ git diff master..my-feature
$ git merge --no-ff my-feature
Clean up
$ git branch -d my-feature
Start Over
Remote
Git & GitHub for Beginners
Git & GitHub for Beginners
We need a remote!
Go to GitHub, create a repo: https://github.com/new
$ git remote add origin https://github.com/<user>/<project>.git
Push
Share the code with your team, and the world
# Generic command
$ git push <remote> <branch>
# What we'll use
$ git push origin master
Pull
# Generic command
$ git pull <remote> <branch>
# What we'll use
$ git pull origin master
Github Desktop app
desktop.github.com
Git & GitHub for Beginners
Profile page
Repository page
Commits & Branches
Pull requests
Issues
Forks
Open source contribution
Github pages
Hosting your website for free!
Repo example: lewagon/ui-components
Thank you!
Ad

More Related Content

What's hot (20)

Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
Arnaud Seilles
 
git and github
git and githubgit and github
git and github
Darren Oakley
 
Techical Workflow for a Startup
Techical Workflow for a StartupTechical Workflow for a Startup
Techical Workflow for a Startup
Sébastien Saunier
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
James Gray
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
Sébastien Saunier
 
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
 
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
 
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git
GitGit
Git
Gayan Kalanamith Mannapperuma
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 

Viewers also liked (15)

Le Wagon On Demand - Behind the scenes
Le Wagon On Demand - Behind the scenesLe Wagon On Demand - Behind the scenes
Le Wagon On Demand - Behind the scenes
Sébastien Saunier
 
Building Layouts with CSS
Building Layouts with CSSBuilding Layouts with CSS
Building Layouts with CSS
Boris Paillard
 
Le wagon UI & design crash course
Le wagon UI & design crash courseLe wagon UI & design crash course
Le wagon UI & design crash course
Mathieu Le Roux
 
Le Wagon - Web 101
Le Wagon - Web 101Le Wagon - Web 101
Le Wagon - Web 101
Edward_Schults
 
Le Wagon - React 101
Le Wagon - React 101Le Wagon - React 101
Le Wagon - React 101
Sébastien Saunier
 
Le Wagon's Product Design Sprint
Le Wagon's Product Design SprintLe Wagon's Product Design Sprint
Le Wagon's Product Design Sprint
Boris Paillard
 
Le wagon Aix-Marseille - sketch
Le wagon Aix-Marseille  -   sketchLe wagon Aix-Marseille  -   sketch
Le wagon Aix-Marseille - sketch
Louis Chavane
 
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScriptLe Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Boris Paillard
 
Le Wagon - Product Specs 101
Le Wagon - Product Specs 101Le Wagon - Product Specs 101
Le Wagon - Product Specs 101
Boris Paillard
 
Le Wagon Brasil - Launching a Tech Product
Le Wagon Brasil - Launching a Tech ProductLe Wagon Brasil - Launching a Tech Product
Le Wagon Brasil - Launching a Tech Product
Mathieu Le Roux
 
Le Wagon - Technical entrepreneurship
Le Wagon - Technical entrepreneurshipLe Wagon - Technical entrepreneurship
Le Wagon - Technical entrepreneurship
Boris Paillard
 
Le Wagon - UI and Design Crash Course
Le Wagon - UI and Design Crash CourseLe Wagon - UI and Design Crash Course
Le Wagon - UI and Design Crash Course
Boris Paillard
 
How Le Wagon uses Trello
How Le Wagon uses TrelloHow Le Wagon uses Trello
How Le Wagon uses Trello
Sébastien Saunier
 
Le wagon - JavaScript for beginners
Le wagon - JavaScript for beginnersLe wagon - JavaScript for beginners
Le wagon - JavaScript for beginners
Edward_Schults
 
Le Wagon On Demand - Behind the scenes
Le Wagon On Demand - Behind the scenesLe Wagon On Demand - Behind the scenes
Le Wagon On Demand - Behind the scenes
Sébastien Saunier
 
Building Layouts with CSS
Building Layouts with CSSBuilding Layouts with CSS
Building Layouts with CSS
Boris Paillard
 
Le wagon UI & design crash course
Le wagon UI & design crash courseLe wagon UI & design crash course
Le wagon UI & design crash course
Mathieu Le Roux
 
Le Wagon's Product Design Sprint
Le Wagon's Product Design SprintLe Wagon's Product Design Sprint
Le Wagon's Product Design Sprint
Boris Paillard
 
Le wagon Aix-Marseille - sketch
Le wagon Aix-Marseille  -   sketchLe wagon Aix-Marseille  -   sketch
Le wagon Aix-Marseille - sketch
Louis Chavane
 
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScriptLe Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Le Wagon - Bootcamp in Ruby on Rails, HTML, CSS and JavaScript
Boris Paillard
 
Le Wagon - Product Specs 101
Le Wagon - Product Specs 101Le Wagon - Product Specs 101
Le Wagon - Product Specs 101
Boris Paillard
 
Le Wagon Brasil - Launching a Tech Product
Le Wagon Brasil - Launching a Tech ProductLe Wagon Brasil - Launching a Tech Product
Le Wagon Brasil - Launching a Tech Product
Mathieu Le Roux
 
Le Wagon - Technical entrepreneurship
Le Wagon - Technical entrepreneurshipLe Wagon - Technical entrepreneurship
Le Wagon - Technical entrepreneurship
Boris Paillard
 
Le Wagon - UI and Design Crash Course
Le Wagon - UI and Design Crash CourseLe Wagon - UI and Design Crash Course
Le Wagon - UI and Design Crash Course
Boris Paillard
 
Le wagon - JavaScript for beginners
Le wagon - JavaScript for beginnersLe wagon - JavaScript for beginners
Le wagon - JavaScript for beginners
Edward_Schults
 
Ad

Similar to Git & GitHub for Beginners (20)

Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
Paulo Henrique Nonaka
 
Git et github (1)
Git et github (1)Git et github (1)
Git et github (1)
AndryRajohnson
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko
 
Git learning
Git learningGit learning
Git learning
Amit Gupta
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
Nguyen Van Hung
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
John(Qiang) Zhang
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git training
Git trainingGit training
Git training
Jérémy Gobet
 
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
 
Git and Github
Git and GithubGit and Github
Git and Github
Teodora Ahkozidou
 
Git
GitGit
Git
AddWeb Solution Pvt. Ltd.
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
UshaSuray
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
PravallikaTammisetty
 
Git&GitHub.pptx
Git&GitHub.pptxGit&GitHub.pptx
Git&GitHub.pptx
KondiVenkatesh1
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
David Newbury
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
Prakash Dantuluri
 
Ad

Git & GitHub for Beginners