SlideShare a Scribd company logo
1 of 31
Essential Git For
Developers
CORK ALT.NET DECEMBER 2013
What is Git?
Distributed version control system
Open source ,written in C
Linus Torvalds 2005 to maintain the linux kernel
Why Git?
•Focuses on content not files
•Opt in when it comes to commits
•Open, not closed– open source model of working is baked into the software
•Distributed - works almost entirely offline
•It changes how you work – commit more often, making code reviews easier
•Browsing history is lightening fast

•Non-linear development
Centralized vs. Distributed
Centralised

Distributed

History only on the server

Complete history of the repo locally

Commit changes online only

Nearly every operation is local (offline) you can
commit locally & branch locally

Down tools if server is down

No hassle if server is down, redundant by default

Branching is difficult

Branching is really easy & lightweight
Branching is no longer a dirty word

Everyone commits to main repo ,typically you check More flexible workflows, you commit changes more
in when your work is complete
regularly
Demo – create a repo and add
some files
Commands
• $git init

• $git add <fileName>
• $git commit –m <commit message>
• $git status

• $git log
• $git command --help
Staging
Working Directory

git add
Staging Area
git commit
Repository
File Status

stackoverflow.com/questions/15653066/how-to-track-but-not-stage-and-how-to-unstage-but-not-untrack
Git stores snapshots, not
differences

git-scm.com/book/en/Getting-Started-Git-Basics
Demo – working with remotes
Commands
• $git remote add <name> <url>

• $git push <remote name> <local branch name>
• $git clone <path to repo>
Git on the Server
Protocols –SSH , HTTP
◦ HTTP - slower but allows anonymous access to the files
◦ SSH - faster but everyone needs a unique SSH key

Hosting Options
◦ Self Hosted (GitLab CE)
◦ GitHub, BitBucket & many more …
Demo – web hook integration
$git pull command
$git fetch + $git merge = $git pull
.gitignore file
Tells git to ignore specific files / folders

https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
Branching
• Think of a branch as simply a movable pointer to one of the commits in your
repository

• $git branch < new branchname >
• $git checkout <branchname>

• $git merge <branchname>
Fast forward merge
Before merging

After merge
3 way merge
Before merging

After merge
Demo – branching and merging
Git-Flow
•Vincent Driessen's branching model
•Defines a branching model designed around the project release, suitable for managing larger
projects / large teams
TIME
Rebasing
“Take my commits and replay them after the HEAD of another branch.”
• take all the changes that were committed on one branch and replay them on another one.

• Moves a branch to a new base commit
• Completely rewrites history!
• Don’t do this on a shared branch
MERGE RESULT

REBASE RESULT
Forking & Pull Requests
Demo – exploring the repo history
Debugging git blame
$git blame [-L ine1,line2]] <file>
• Lets you see when each line of a method was edited and by whom
Debugging git bisect
$ git bisect start
$ git bisect bad HEAD
$ git bisect good 1b6d
Cherry Picking
If you want to get one single commit out of a branch

$git cherry-pick <sha-1_commit>
Git on Windows
GUI Clients

Shells

SourceTree (free)

Bash

GitHub for Windows

Posh-git

Git GUI for Windows

Powershell

TortoiseGit

Cmd
Advice for getting started
•Learning curve
•Start with the command line, not the GUI
• Agree a good branch strategy with your team up front
• (Almost) every should be short lived, and kept up to date with master
•Commit often, perfect later & user meaningful commit messages
Thanks for listening!
twitter : @AIDANJCASEY

More Related Content

What's hot

Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud Foundry
Emilio Garcia
 

What's hot (20)

Vagrant for Effective DevOps Culture
Vagrant for Effective DevOps CultureVagrant for Effective DevOps Culture
Vagrant for Effective DevOps Culture
 
Windows azure mobile services from start to rest
Windows azure mobile services from start to restWindows azure mobile services from start to rest
Windows azure mobile services from start to rest
 
Bosh - Configuring Services
Bosh - Configuring ServicesBosh - Configuring Services
Bosh - Configuring Services
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Serverless with Azure Functions
Serverless with Azure FunctionsServerless with Azure Functions
Serverless with Azure Functions
 
Container Patterns
Container PatternsContainer Patterns
Container Patterns
 
Microservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud FoundryMicroservices, Spring Cloud & Cloud Foundry
Microservices, Spring Cloud & Cloud Foundry
 
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
 
Containerization: The DevOps Revolution
Containerization: The DevOps Revolution Containerization: The DevOps Revolution
Containerization: The DevOps Revolution
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeSession Slides from DEVintersection Europe
Session Slides from DEVintersection Europe
 
Aws user group #01 lets talk serverless
Aws user group #01   lets talk serverlessAws user group #01   lets talk serverless
Aws user group #01 lets talk serverless
 
Cost Control Across Cloud, On-Premise and VM Computers by Mark Lavi, Calm.io
Cost Control Across Cloud, On-Premise and VM Computers by Mark Lavi, Calm.ioCost Control Across Cloud, On-Premise and VM Computers by Mark Lavi, Calm.io
Cost Control Across Cloud, On-Premise and VM Computers by Mark Lavi, Calm.io
 
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
 
Using Chat Automation - ChatOps
Using Chat Automation - ChatOpsUsing Chat Automation - ChatOps
Using Chat Automation - ChatOps
 
Automation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrellaAutomation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrella
 
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
The Pivotal Engineering Dojo: Earning Your Black Belt in Cloud Foundry Engine...
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
 
Azure Batch and MPI
Azure Batch and MPIAzure Batch and MPI
Azure Batch and MPI
 
Secure your environment by automation
Secure your environment by automationSecure your environment by automation
Secure your environment by automation
 
Continuous Deployment with Containers
Continuous Deployment with ContainersContinuous Deployment with Containers
Continuous Deployment with Containers
 

Viewers also liked

Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
Effective
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AK
Alexey Kononenko
 

Viewers also liked (11)

Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Evernote
EvernoteEvernote
Evernote
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
[Easy] How to use Evernote: Beginner's Guide
[Easy]  How to use Evernote: Beginner's Guide[Easy]  How to use Evernote: Beginner's Guide
[Easy] How to use Evernote: Beginner's Guide
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AK
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C#
 

Similar to Essential git for developers

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
 

Similar to Essential git for developers (20)

Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
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
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Git basics
Git basicsGit basics
Git basics
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Git
GitGit
Git
 
Git more done
Git more doneGit more done
Git more done
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Git
GitGit
Git
 
O365Con18 - Git and GitHub - Rick van Rousselt
O365Con18 - Git and GitHub - Rick van RousseltO365Con18 - Git and GitHub - Rick van Rousselt
O365Con18 - Git and GitHub - Rick van Rousselt
 
Git training v10
Git training v10Git training v10
Git training v10
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
Living with Files More Happily
Living with Files More HappilyLiving with Files More Happily
Living with Files More Happily
 

More from Aidan Casey

Cloud arena accelerate your mobile development
Cloud arena   accelerate your mobile developmentCloud arena   accelerate your mobile development
Cloud arena accelerate your mobile development
Aidan Casey
 

More from Aidan Casey (12)

The Agony and the Ecstasy of being Agile when the Schedule is Not
The Agony and the Ecstasy of being Agile when the Schedule is NotThe Agony and the Ecstasy of being Agile when the Schedule is Not
The Agony and the Ecstasy of being Agile when the Schedule is Not
 
Rise of the Machines - AI in the Agile World
Rise of the Machines - AI in the Agile WorldRise of the Machines - AI in the Agile World
Rise of the Machines - AI in the Agile World
 
Organisations must celebrate failure to achieve success
Organisations must celebrate failure to achieve successOrganisations must celebrate failure to achieve success
Organisations must celebrate failure to achieve success
 
Organisations must celebrate failure to achieve success
Organisations must celebrate failure to achieve success Organisations must celebrate failure to achieve success
Organisations must celebrate failure to achieve success
 
Agile in the City London - creating a sense of purpose in agile teams
Agile in the City London - creating a sense of purpose in agile teamsAgile in the City London - creating a sense of purpose in agile teams
Agile in the City London - creating a sense of purpose in agile teams
 
Creating a sense of purpose in agile teams
Creating a sense of purpose in agile teamsCreating a sense of purpose in agile teams
Creating a sense of purpose in agile teams
 
Evolutionary architecture guiding principles
Evolutionary architecture guiding principlesEvolutionary architecture guiding principles
Evolutionary architecture guiding principles
 
Building mobile back ends with windows azure mobile services
Building mobile back ends with windows azure mobile servicesBuilding mobile back ends with windows azure mobile services
Building mobile back ends with windows azure mobile services
 
Cloud arena accelerate your mobile development
Cloud arena   accelerate your mobile developmentCloud arena   accelerate your mobile development
Cloud arena accelerate your mobile development
 
A lap around AWS
A lap around AWS A lap around AWS
A lap around AWS
 
Building node.js applications on windows azure
Building node.js applications on windows azureBuilding node.js applications on windows azure
Building node.js applications on windows azure
 
Myob beyond patents, practical ways to protect your software ip
Myob    beyond patents, practical ways to protect your software ipMyob    beyond patents, practical ways to protect your software ip
Myob beyond patents, practical ways to protect your software ip
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Essential git for developers