SlideShare una empresa de Scribd logo
1 de 51
Descargar para leer sin conexión
Git & Github - version control
for the modern developer
by John Stevenson
@jr0cket
git.practical.li
Why Git / Version control
Helping us manage and collaborate
We learn from history, so don't delete it
Those who cannot remember the
past are condemned to repeat it
- George Santayana
History at your fingertips
git log --oneline --decorate
Version control should be easy
Every developer should be able to manage changes without a dedicated
version control team
- makes developers more likely to version their software more often
- smaller commits
- meaningful commit messages
- easy merging of changes
- easy to experiment & throw away code
What is Git...
it's not just me when I am being grumpy...
Distributed vs Centralised model
Distributed vs Centralised model
Centralised
- only 1 server, single version of the truth
- typically a locking approach
- requires central server setup
- single point of failure in central server
- only use when connected to the network
Distributed
- only requires git init to start versioning
- have the whole project to work with
- multiple repositories give redundancy
- commit changes offline & fast
- easy to share changes & collaborate
- need to decide canonical source of truth
Distributed model in action
Getting Started with Git...
it's not just me when I am being grumpy...
Install a Git Client
Install your prefered Git Client
git-scm.com/downloads/guis
Identifying yourself with Git
Labels every commit you make with your identity
git config --global user.name “John Stevenson”
git config --global user.email “john@jr0cket.co.uk”
Git graphical clients also allow you to set your identity and usually save this
into your ~/.gitconf file
Tools to Git
choose your tools and learn them well...
- Windows & MacOSX
desktop.github.com
Emacs Magit - very powerful & easy to use
SourceTree - Atlassian
GitKraken.com
Git Command Line
Git local workflow
version your changes locally, before sharing them
Create a local repository:
git init
Edit your source code (working copy)
Add changes you want to capture in the
next commit
git add filename or file pattern
See what files you have changed / added
git status
Compare changes in working copy
git diff filename
git diff --cached filename
Create a commit from the added files:
git commit -m “meaningful message”
See the current history of commits
git log --oneline --decorate
See the contents of a commit
git show commit-number
Dont delete the .git directory or you
loose all the history of the project
Git Visual Cheatsheet ndpsoftware.com/git-cheatsheet.html
Collaborating with Github
additional services around Git
What is Github
Github is a cloud service for managing & sharing changes
- provides private & public repositories
- repository forks & pull requests
- collaborative code review
- Gists for single file sharing
Github pages website publishing
- markdown driven content
Authentication methods
- SSH Keys vs Passwords
SSH authentication
- uses a public/private key to authenticate, so no passwords
- keys needs to be added to each computer you use
Password authentication
- account can be cached to minimise typing of credentials
Creating a
repository
Cloning a Github Repository
Clone (copy completely) an existing repository, giving an optional directory name
git clone URL directory-name
Forking a Github Repository
You can fork to
your account or
any Github
Organisation you
belong too
Submit
a pull
request
Github Pull
Request
-
Accepted
& Merged
Github Pull Request
-
Code Review
Visualising Github - ghv.artzub.com
Branching & Merging
branches should allow experimentation,
merging should be simple
Branching
Branches allow you to work on
- specific features
- bug fixes
- ideas / experiments
Branches can
- merged into another branch
- have commits cherry picked
- be discarded easily
- be attached to another branch or be
stand alone (eg. gh-pages)
Creating a branch
git branch branch-name ;; create a branch attached to the current branch
git checkout branch-name ;; checkout branch so new commits are added to it
git checkout -b branch-name ;; both commands above in one command
git branch ;; lists all branches
Creating a stand alone (orphan) branch
git branch -o branch-name ;; branch independent of others & shares no history
Branching - discarding
Branches can live forever, the longer they live become harder to merge
git branch -d branch-name
If this branch is also on a remote git repository, you need to push this change
git push remote branch-name
Or simply delete a branch reference on the remote git repository
git push remote --delete branch-name
Merging
Checkout branch to
receive the merge
commits
git checkout master
git merge feature
Rebasing - only with consent!
Note: Anything that affects the history should be done with consent,
especially once commits are shared
Checkout branch to
receive the merge
commits
git checkout feature
git rebase master
Cherry Picking
Checkout branch to receive the
cherry picked commit
git checkout master
git cherry-pick commit-number
Deploying with Git
Git can be an important part of your release management
Example: Heroku
git push heroku master
Example: Heroku
git push heroku master
Learning Git in-depth
we learn by example...
Books on Git
progit.org
gitforteams.com
atlassian.com/git/tutorials
Take your own journey into Git
Thank you
@jr0cket
jr0cket.co.uk

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Git
GitGit
Git
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git
GitGit
Git
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Github basics
Github basicsGithub basics
Github basics
 
Learning git
Learning gitLearning git
Learning git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
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
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 

Destacado

Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / GithubPaige Bailey
 
Communication improbable
Communication improbableCommunication improbable
Communication improbableJohn Stevenson
 
Introduction au Kanban et expérience pratique chez IBM Bromont
Introduction au Kanban et expérience pratique chez IBM BromontIntroduction au Kanban et expérience pratique chez IBM Bromont
Introduction au Kanban et expérience pratique chez IBM BromontAgile Tour 2009 Québec
 
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015Cyrille Deruel
 
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)Cyrille Deruel
 
L'Obeya - Agile France 2015
L'Obeya - Agile France 2015L'Obeya - Agile France 2015
L'Obeya - Agile France 2015Operae Partners
 
kanban, un outil de production
kanban, un outil de productionkanban, un outil de production
kanban, un outil de productionYannick Quenec'hdu
 
Dessine moi une obeya kanban!
Dessine moi une obeya kanban!Dessine moi une obeya kanban!
Dessine moi une obeya kanban!Laurent Morisseau
 
Tableaux kanban pas à pas FR
Tableaux kanban pas à pas FRTableaux kanban pas à pas FR
Tableaux kanban pas à pas FRFranck Beulé
 
Lean Agile Kanban Guide du Routard 2014
Lean Agile Kanban Guide du Routard 2014Lean Agile Kanban Guide du Routard 2014
Lean Agile Kanban Guide du Routard 2014Christophe Keromen
 
La gestion par la méthode de kanban
La gestion par la méthode de kanbanLa gestion par la méthode de kanban
La gestion par la méthode de kanbanHajar EL GUERI
 
Personal Kanban depuis les tranchées - Culture Kanban 2016
Personal Kanban depuis les tranchées - Culture Kanban 2016Personal Kanban depuis les tranchées - Culture Kanban 2016
Personal Kanban depuis les tranchées - Culture Kanban 2016Eric SIBER
 
3 années de Kanban chez Sandvik IT
3 années de Kanban chez Sandvik IT3 années de Kanban chez Sandvik IT
3 années de Kanban chez Sandvik ITFabrice Aimetti
 
Jeu du kanban
Jeu du kanbanJeu du kanban
Jeu du kanbanCIPE
 
Personal kanban breizhcamp
Personal kanban   breizhcampPersonal kanban   breizhcamp
Personal kanban breizhcampGuillaume LOURS
 
A la recherche du temps perdu - Agile Tour Paris 2011
A la recherche du temps perdu - Agile Tour Paris 2011A la recherche du temps perdu - Agile Tour Paris 2011
A la recherche du temps perdu - Agile Tour Paris 2011ENSIBS
 

Destacado (19)

Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introduction to Git / Github
Introduction to Git / GithubIntroduction to Git / Github
Introduction to Git / Github
 
Rex kanban hors it
Rex kanban hors itRex kanban hors it
Rex kanban hors it
 
Communication improbable
Communication improbableCommunication improbable
Communication improbable
 
Introduction au Kanban et expérience pratique chez IBM Bromont
Introduction au Kanban et expérience pratique chez IBM BromontIntroduction au Kanban et expérience pratique chez IBM Bromont
Introduction au Kanban et expérience pratique chez IBM Bromont
 
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015
Comment j'ai amélioré mon Kanban grâce à Bison futé - KanbanDay FR 2015
 
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)
Lean Kanban France 2015 : Le Kanban explique par bison futé (V1.6)
 
L'Obeya - Agile France 2015
L'Obeya - Agile France 2015L'Obeya - Agile France 2015
L'Obeya - Agile France 2015
 
kanban, un outil de production
kanban, un outil de productionkanban, un outil de production
kanban, un outil de production
 
Dessine moi une obeya kanban!
Dessine moi une obeya kanban!Dessine moi une obeya kanban!
Dessine moi une obeya kanban!
 
Tableaux kanban pas à pas FR
Tableaux kanban pas à pas FRTableaux kanban pas à pas FR
Tableaux kanban pas à pas FR
 
Lean Agile Kanban Guide du Routard 2014
Lean Agile Kanban Guide du Routard 2014Lean Agile Kanban Guide du Routard 2014
Lean Agile Kanban Guide du Routard 2014
 
La gestion par la méthode de kanban
La gestion par la méthode de kanbanLa gestion par la méthode de kanban
La gestion par la méthode de kanban
 
Personal Kanban depuis les tranchées - Culture Kanban 2016
Personal Kanban depuis les tranchées - Culture Kanban 2016Personal Kanban depuis les tranchées - Culture Kanban 2016
Personal Kanban depuis les tranchées - Culture Kanban 2016
 
3 années de Kanban chez Sandvik IT
3 années de Kanban chez Sandvik IT3 années de Kanban chez Sandvik IT
3 années de Kanban chez Sandvik IT
 
Jeu du kanban
Jeu du kanbanJeu du kanban
Jeu du kanban
 
Personal kanban
Personal kanbanPersonal kanban
Personal kanban
 
Personal kanban breizhcamp
Personal kanban   breizhcampPersonal kanban   breizhcamp
Personal kanban breizhcamp
 
A la recherche du temps perdu - Agile Tour Paris 2011
A la recherche du temps perdu - Agile Tour Paris 2011A la recherche du temps perdu - Agile Tour Paris 2011
A la recherche du temps perdu - Agile Tour Paris 2011
 

Similar a Git and github - Verson Control for the Modern Developer

Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenchesNuno Caneco
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced gitGerrit Wanderer
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with gitDídac Ríos
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystemFrançois D'Agostini
 
01 git interview questions & answers
01   git interview questions & answers01   git interview questions & answers
01 git interview questions & answersDeepQuest Software
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubDSC GVP
 
Git tutorial
Git tutorialGit tutorial
Git tutorialmobaires
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__greyKing Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__whiteKing Hom
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_darkKing Hom
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-BryanLearningTech
 

Similar a Git and github - Verson Control for the Modern Developer (20)

Git workshop
Git workshopGit workshop
Git workshop
 
Git 101
Git 101Git 101
Git 101
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git
GitGit
Git
 
01 git interview questions & answers
01   git interview questions & answers01   git interview questions & answers
01 git interview questions & answers
 
Git and github
Git and githubGit and github
Git and github
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Git github
Git githubGit github
Git github
 

Más de John Stevenson

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureJohn Stevenson
 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builderJohn Stevenson
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptJohn Stevenson
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptJohn Stevenson
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with ClojureJohn Stevenson
 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferencesJohn Stevenson
 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojureJohn Stevenson
 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with ClojureJohn Stevenson
 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into ClojureJohn Stevenson
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with ClojureJohn Stevenson
 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?John Stevenson
 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudJohn Stevenson
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developersJohn Stevenson
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platformJohn Stevenson
 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlJohn Stevenson
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with ClojureJohn Stevenson
 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionJohn Stevenson
 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesJohn Stevenson
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformJohn Stevenson
 
Developer week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewDeveloper week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewJohn Stevenson
 

Más de John Stevenson (20)

ClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of ClojureClojureX Conference 2017 - 10 amazing years of Clojure
ClojureX Conference 2017 - 10 amazing years of Clojure
 
Confessions of a developer community builder
Confessions of a developer community builderConfessions of a developer community builder
Confessions of a developer community builder
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in ClojurescriptProgscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
 
Introduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with ClojurescriptIntroduction to Functional Reactive Web with Clojurescript
Introduction to Functional Reactive Web with Clojurescript
 
Thinking Functionally with Clojure
Thinking Functionally with ClojureThinking Functionally with Clojure
Thinking Functionally with Clojure
 
Getting into public speaking at conferences
Getting into public speaking at conferencesGetting into public speaking at conferences
Getting into public speaking at conferences
 
Functional web with clojure
Functional web with clojureFunctional web with clojure
Functional web with clojure
 
Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with Clojure
 
Guiding people into Clojure
Guiding people into ClojureGuiding people into Clojure
Guiding people into Clojure
 
Get Functional Programming with Clojure
Get Functional Programming with ClojureGet Functional Programming with Clojure
Get Functional Programming with Clojure
 
So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?So you want to run a developer event, are you crazy?
So you want to run a developer event, are you crazy?
 
Trailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App CloudTrailhead live - Overview of Salesforce App Cloud
Trailhead live - Overview of Salesforce App Cloud
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Dreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version ControlDreamforce14 Metadata Management with Git Version Control
Dreamforce14 Metadata Management with Git Version Control
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Salesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - IntroductionSalesforce Summer of Hacks London - Introduction
Salesforce Summer of Hacks London - Introduction
 
Heroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & servicesHeroku Introduction: Scaling customer facing apps & services
Heroku Introduction: Scaling customer facing apps & services
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 
Developer week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overviewDeveloper week EMEA - Salesforce1 Mobile App overview
Developer week EMEA - Salesforce1 Mobile App overview
 

Último

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Último (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

Git and github - Verson Control for the Modern Developer

  • 1. Git & Github - version control for the modern developer by John Stevenson @jr0cket git.practical.li
  • 2.
  • 3. Why Git / Version control Helping us manage and collaborate
  • 4. We learn from history, so don't delete it Those who cannot remember the past are condemned to repeat it - George Santayana
  • 5. History at your fingertips git log --oneline --decorate
  • 6. Version control should be easy Every developer should be able to manage changes without a dedicated version control team - makes developers more likely to version their software more often - smaller commits - meaningful commit messages - easy merging of changes - easy to experiment & throw away code
  • 7. What is Git... it's not just me when I am being grumpy...
  • 9. Distributed vs Centralised model Centralised - only 1 server, single version of the truth - typically a locking approach - requires central server setup - single point of failure in central server - only use when connected to the network Distributed - only requires git init to start versioning - have the whole project to work with - multiple repositories give redundancy - commit changes offline & fast - easy to share changes & collaborate - need to decide canonical source of truth
  • 10.
  • 12. Getting Started with Git... it's not just me when I am being grumpy...
  • 13. Install a Git Client Install your prefered Git Client git-scm.com/downloads/guis
  • 14. Identifying yourself with Git Labels every commit you make with your identity git config --global user.name “John Stevenson” git config --global user.email “john@jr0cket.co.uk” Git graphical clients also allow you to set your identity and usually save this into your ~/.gitconf file
  • 15. Tools to Git choose your tools and learn them well...
  • 16. - Windows & MacOSX desktop.github.com
  • 17. Emacs Magit - very powerful & easy to use
  • 21. Git local workflow version your changes locally, before sharing them
  • 22. Create a local repository: git init Edit your source code (working copy) Add changes you want to capture in the next commit git add filename or file pattern See what files you have changed / added git status Compare changes in working copy git diff filename git diff --cached filename
  • 23. Create a commit from the added files: git commit -m “meaningful message” See the current history of commits git log --oneline --decorate See the contents of a commit git show commit-number Dont delete the .git directory or you loose all the history of the project
  • 24. Git Visual Cheatsheet ndpsoftware.com/git-cheatsheet.html
  • 26. What is Github Github is a cloud service for managing & sharing changes - provides private & public repositories - repository forks & pull requests - collaborative code review - Gists for single file sharing Github pages website publishing - markdown driven content
  • 27.
  • 28. Authentication methods - SSH Keys vs Passwords SSH authentication - uses a public/private key to authenticate, so no passwords - keys needs to be added to each computer you use Password authentication - account can be cached to minimise typing of credentials
  • 30. Cloning a Github Repository Clone (copy completely) an existing repository, giving an optional directory name git clone URL directory-name
  • 31. Forking a Github Repository You can fork to your account or any Github Organisation you belong too
  • 35. Visualising Github - ghv.artzub.com
  • 36. Branching & Merging branches should allow experimentation, merging should be simple
  • 37. Branching Branches allow you to work on - specific features - bug fixes - ideas / experiments Branches can - merged into another branch - have commits cherry picked - be discarded easily - be attached to another branch or be stand alone (eg. gh-pages)
  • 38. Creating a branch git branch branch-name ;; create a branch attached to the current branch git checkout branch-name ;; checkout branch so new commits are added to it git checkout -b branch-name ;; both commands above in one command git branch ;; lists all branches Creating a stand alone (orphan) branch git branch -o branch-name ;; branch independent of others & shares no history
  • 39. Branching - discarding Branches can live forever, the longer they live become harder to merge git branch -d branch-name If this branch is also on a remote git repository, you need to push this change git push remote branch-name Or simply delete a branch reference on the remote git repository git push remote --delete branch-name
  • 40. Merging Checkout branch to receive the merge commits git checkout master git merge feature
  • 41. Rebasing - only with consent! Note: Anything that affects the history should be done with consent, especially once commits are shared Checkout branch to receive the merge commits git checkout feature git rebase master
  • 42. Cherry Picking Checkout branch to receive the cherry picked commit git checkout master git cherry-pick commit-number
  • 43. Deploying with Git Git can be an important part of your release management
  • 44. Example: Heroku git push heroku master
  • 45. Example: Heroku git push heroku master
  • 46.
  • 47. Learning Git in-depth we learn by example...
  • 50. Take your own journey into Git