SlideShare a Scribd company logo
Introduction to Git
10/2/2013
Rick Umali
rickumali@gmail.com
@rickumali
http://tech.rickumali.com/
This presentation is on Google Drive at:
http://sn.im/git-talk-2013
There you can read the 'speaker notes' for this
presentation.
What is Source Control?
Source code control is the most important
practice a coding professional can do.
A mechanism to track changes in source code.
Used for version history, auditing, and
recovery.
Revision Control Example: Wiki
Revision Control Example: Git
You’ll learn how to make a repository like this.
Git
Git is an open source, distributed version
control system designed for speed and
efficiency.
Freedom
No "server" required
Unique architecture
Warning: Command Line Ahead
Our Example: A Basic Drupal Module
Creating a Repository
% cd web/sites/all/modules
% mkdir dumpstamp
% cd dumpstamp
% git init
"git init" creates the entire Git repository.
No server interaction required!
Committing Your First File
To 'commit' means 'to save the state' of your
work. You must first 'add' this change to the
'staging area'.
% vi README.txt
% git add README.txt
% git commit -m "First commit. README file."
Commit often!
Looking at the Repository History
% git log
% gitk
Adding More Files
% vi dumpstamp.info dumpstamp.module
% git status
% git add .
% git commit
or
% git commit -a -m “My commit message.”
Learn the shortcuts by reading Git docs.
Examining Changes to Files
% vi dumpstamp.module
% git status
% git diff
% git add dumpstamp.module
% git commit
% git log
Become familiar with Git status and diff
output.
Make your commit messages meaningful!
Looking at the Log Again
The history can be examined different ways.
% git log --format=short
% git log --format=oneline
% git log --oneline
Revisiting History
You can 'revisit' any point of your history.
% git checkout SHA_ID
Checkout makes the working directory match
the state of the specific SHA_ID.
This is a time machine!
Returning to the Present
At all times, Git retains a pointer to the
‘present’.
% git checkout master
Branching and Merging Next, But...
What we have covered so far is probably 70-
80% of what you will do with git.
Adding and committing files are the heart of
git (and any version control system).
Git encourages experimentation, by making
branching very easy!
Branching
Branching: git branch
% git branch BRANCH
% git checkout BRANCH
This makes a branch from “where you
currently are”, and then “switches” (checks
out) the branch.
“git branch” tells you what branch you’re on.
Branching: Starting State
SHA 1Amaster
NOTE: 'master' is a branch that's created 'by default'.
Branching: Make Some Changes
SHA 1A
SHA 2Bmaster
git commit
Branching: Making a Branch
SHA 1A
SHA 2Bmaster branch1
git branch branch1
git checkout branch1
OR git checkout -b branch1
Branching: Changes on the Branch
SHA 1A
SHA 2Bmaster
SHA 3C
(Make changes in "branch1".)
git commit
branch1
Branching: Making a New Branch
SHA 1A
SHA 2Bmaster
SHA 3C
git checkout master
git checkout -b branch2
branch1
branch2
Branching: Changes on another
Branch
SHA 1A
SHA 2Bmaster
branch2SHA 4D
(Make changes in "branch2".)
git commit
branch1 SHA 3C
Visualizing the Branches
Merging
Bringing two branches together.
First 'checkout' the branch you want to merge
into (typically master), then 'merge' in branch.
% git checkout master
% git merge BRANCH
Merging: Starting State
SHA 1A
SHA 2Bmaster
branch2SHA 4Dbranch1 SHA 3C
Merging: Fast-Forward Merge
git checkout master
git merge branch1
SHA 1A
SHA 2B
branch2SHA 4Cmaster, branch1 SHA 3C
Merging: Resolving Conflicts
git merge branch2
SHA 1A
SHA 2B
branch2SHA 4Cbranch1 SHA 3C
SHA 5 master
Merging: The Hard Part
Manual 'merging' may be required.
Visualizing the Merge
Whew!
Using Git “Remotely”
You can upload your local Git repository to a
public Git repository. These repositories are
known as remotes.
Using “remotes” is the key to collaborating.
Visualizing Remotes
Your Repo Bob Repo
GitHub Repo
Uploading New Code to GitHub
Create a repository (on GitHub).
Add a 'remote' (via git remote add).
Upload your code (via git push).
Creating a Repository
git init
Adding a Remote
git remote adds a name for a repo at a
specific URL
git remote add origin git@github.com:rickumali/DumpStamp.
git
Your Repo GitHub Repo
(origin)
Dumpstamp.git
This is just a naming step!
Push Your Repo to the Remote
% git push -u origin master
Visualizing the Push
git push uploads the repository to the remote
Your Repo GitHub Repo
(origin)
Visualizing Remotes (cloning)
Your Repo Bob Repo
GitHub Repo
(origin)
Now Bob can ‘clone’ your repository
clone
Cloning
After the Clone
The Cycle with Remotes
Your Repo Bob Repo
GitHub Repo
(origin)
You Push, Bob “Pulls” (or Fetches/Merges)
pullpush
You Saw and Learned A Lot About Git
Typical Git Commands
Add, Commit, Log, Diff, Status
Branch and Merging
Git Remote Repositories
Next Steps
Install Git
Commit frequently and log verbosely
Experiment (branch) often
Introduction to Git
10/2/2013
Rick Umali
rickumali@gmail.com
@rickumali
http://tech.rickumali.com/
This presentation is on Google Drive at:
http://sn.im/git-talk-2013
There you can read the 'speaker notes' for this
presentation.
Resources
http://sethrobertson.github.io/GitBestPractices/
Great list of Git best practices.
http://git-scm.org/
Both "Pro Git" book, and Git reference
http://gitref.org/
A "quicker" Git reference
http://www-cs-students.stanford.edu/~blynn/gitmagic/
"Friendlier" Git walk-through (git magic).
http://www.mail-archive.com/dri-devel@lists.
sourceforge.net/msg39091.html
Linus on "clean history."
Resources
http://www.youtube.com/watch?v=4XpnKHJAok8
Linus Torvalds (Git creator) (May '07)
http://www.youtube.com/watch?v=8dhZ9BXQgc4
Randal Schwartz (Perl expert and Git old-timer) (Oct
'07)
http://www.youtube.com/watch?v=ZDR433b0HJY
Scott Chacon (Pro Git author) (July '11)

More Related Content

What's hot

The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Git & Github
Git & GithubGit & Github
Git & Github
Aman Lalpuria
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
DSCVSSUT
 
Git Tricks
Git TricksGit Tricks
Git Tricks
Ivelina Dimova
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
Salvatore Cordiano
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - Git
Carlo Bernaschina
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
Sergiu-Ioan Ungur
 
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 Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Houari ZEGAI
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
GoogleDevelopersStud1
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
Ariejan de Vroom
 
Recovering From Git Mistakes - Nina Zakharenko
Recovering From Git Mistakes - Nina ZakharenkoRecovering From Git Mistakes - Nina Zakharenko
Recovering From Git Mistakes - Nina Zakharenko
Nina Zakharenko
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
Cesar Martinez
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
Mireia Sangalo
 
Git presentation
Git presentationGit presentation
Git presentation
Sai Kumar Satapathy
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
Daniel Kummer
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Luca Milanesio
 
Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and Tags
Mikhail Melnik
 

What's hot (20)

The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
Introduction to Git (part 1)
Introduction to Git (part 1)Introduction to Git (part 1)
Introduction to Git (part 1)
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - Git
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
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 ...
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Recovering From Git Mistakes - Nina Zakharenko
Recovering From Git Mistakes - Nina ZakharenkoRecovering From Git Mistakes - Nina Zakharenko
Recovering From Git Mistakes - Nina Zakharenko
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
Git
GitGit
Git
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
 
Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and Tags
 

Viewers also liked

Finding Success: Social Media
Finding Success: Social MediaFinding Success: Social Media
Finding Success: Social Media
Craig Daitch
 
SEO Analytics - Huzzah workshop
SEO Analytics - Huzzah workshopSEO Analytics - Huzzah workshop
SEO Analytics - Huzzah workshopIan Lurie
 
NZ Social Media State of the Nation 2015
NZ Social Media State of the Nation 2015NZ Social Media State of the Nation 2015
NZ Social Media State of the Nation 2015
Simon Young
 
How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013
Kivi Leroux Miller
 
NRG Shipping Solutions Overview
NRG Shipping Solutions OverviewNRG Shipping Solutions Overview
NRG Shipping Solutions Overview
NRG Software
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patternsdeimos
 
My 2nd Grader's App Idea - Who wants in ? The road puzzle game
My 2nd Grader's App Idea - Who wants in ? The road puzzle gameMy 2nd Grader's App Idea - Who wants in ? The road puzzle game
My 2nd Grader's App Idea - Who wants in ? The road puzzle game
Shashi Bellamkonda
 
Using GO's to Improve Student Learning
Using GO's to Improve Student LearningUsing GO's to Improve Student Learning
Using GO's to Improve Student LearningJim Ellis
 
Experience Learning Live
Experience Learning LiveExperience Learning Live
Experience Learning Live
darkwing1876
 
Advanced SEO - Huzzah seminar
Advanced SEO - Huzzah seminarAdvanced SEO - Huzzah seminar
Advanced SEO - Huzzah seminarIan Lurie
 
2007 development of a who growth reference for school aged children and adole...
2007 development of a who growth reference for school aged children and adole...2007 development of a who growth reference for school aged children and adole...
2007 development of a who growth reference for school aged children and adole...Raul Rojas
 
The Black List - Vol. 1 - Social Media Masters
The Black List - Vol. 1 - Social Media MastersThe Black List - Vol. 1 - Social Media Masters
The Black List - Vol. 1 - Social Media Masters
Michael Street
 
Video Games and Reader's Advisory
Video Games and Reader's AdvisoryVideo Games and Reader's Advisory
Video Games and Reader's Advisory
Maggie Hommel Thomann
 
Day 2 2nd_weekcris
Day 2 2nd_weekcrisDay 2 2nd_weekcris
Day 2 2nd_weekcriscristiarnau
 
Les riuades del segle XX
Les riuades del segle XXLes riuades del segle XX
Les riuades del segle XXamestre4
 
Trends In New Media Luncheon at Optsum 2010
Trends In New Media Luncheon at Optsum 2010Trends In New Media Luncheon at Optsum 2010
Trends In New Media Luncheon at Optsum 2010
Shashi Bellamkonda
 
Survival Tips for Nonprofit Marketers
Survival Tips for Nonprofit MarketersSurvival Tips for Nonprofit Marketers
Survival Tips for Nonprofit Marketers
Kivi Leroux Miller
 
Setting Up Your Local Dev Environment
Setting Up Your Local Dev EnvironmentSetting Up Your Local Dev Environment
Setting Up Your Local Dev Environment
Rick Umali
 

Viewers also liked (20)

Finding Success: Social Media
Finding Success: Social MediaFinding Success: Social Media
Finding Success: Social Media
 
SEO Analytics - Huzzah workshop
SEO Analytics - Huzzah workshopSEO Analytics - Huzzah workshop
SEO Analytics - Huzzah workshop
 
NZ Social Media State of the Nation 2015
NZ Social Media State of the Nation 2015NZ Social Media State of the Nation 2015
NZ Social Media State of the Nation 2015
 
How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013How Nonprofit Communicators Combine Goals for 2013
How Nonprofit Communicators Combine Goals for 2013
 
Onddoak 1 T
Onddoak 1 TOnddoak 1 T
Onddoak 1 T
 
NRG Shipping Solutions Overview
NRG Shipping Solutions OverviewNRG Shipping Solutions Overview
NRG Shipping Solutions Overview
 
Ari Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture PatternsAri Zilka Cluster Architecture Patterns
Ari Zilka Cluster Architecture Patterns
 
My 2nd Grader's App Idea - Who wants in ? The road puzzle game
My 2nd Grader's App Idea - Who wants in ? The road puzzle gameMy 2nd Grader's App Idea - Who wants in ? The road puzzle game
My 2nd Grader's App Idea - Who wants in ? The road puzzle game
 
Using GO's to Improve Student Learning
Using GO's to Improve Student LearningUsing GO's to Improve Student Learning
Using GO's to Improve Student Learning
 
Experience Learning Live
Experience Learning LiveExperience Learning Live
Experience Learning Live
 
Bright Ideas
Bright IdeasBright Ideas
Bright Ideas
 
Advanced SEO - Huzzah seminar
Advanced SEO - Huzzah seminarAdvanced SEO - Huzzah seminar
Advanced SEO - Huzzah seminar
 
2007 development of a who growth reference for school aged children and adole...
2007 development of a who growth reference for school aged children and adole...2007 development of a who growth reference for school aged children and adole...
2007 development of a who growth reference for school aged children and adole...
 
The Black List - Vol. 1 - Social Media Masters
The Black List - Vol. 1 - Social Media MastersThe Black List - Vol. 1 - Social Media Masters
The Black List - Vol. 1 - Social Media Masters
 
Video Games and Reader's Advisory
Video Games and Reader's AdvisoryVideo Games and Reader's Advisory
Video Games and Reader's Advisory
 
Day 2 2nd_weekcris
Day 2 2nd_weekcrisDay 2 2nd_weekcris
Day 2 2nd_weekcris
 
Les riuades del segle XX
Les riuades del segle XXLes riuades del segle XX
Les riuades del segle XX
 
Trends In New Media Luncheon at Optsum 2010
Trends In New Media Luncheon at Optsum 2010Trends In New Media Luncheon at Optsum 2010
Trends In New Media Luncheon at Optsum 2010
 
Survival Tips for Nonprofit Marketers
Survival Tips for Nonprofit MarketersSurvival Tips for Nonprofit Marketers
Survival Tips for Nonprofit Marketers
 
Setting Up Your Local Dev Environment
Setting Up Your Local Dev EnvironmentSetting Up Your Local Dev Environment
Setting Up Your Local Dev Environment
 

Similar to Introduction to Git

Getting Into Git
Getting Into GitGetting Into Git
Getting Into Git
Rick Umali
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
Alberto Leal
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko
 
Git
GitGit
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
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
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Boise Web Technologies Group
 
Github
GithubGithub
Git slides
Git slidesGit slides
Git slides
Nanyak S
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
murad khan
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for Beginners
Rick Umali
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Nyros Technologies
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
 

Similar to Introduction to Git (20)

Getting Into Git
Getting Into GitGetting Into Git
Getting Into Git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
Git
GitGit
Git
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
 
Github
GithubGithub
Github
 
Git slides
Git slidesGit slides
Git slides
 
Git presentation
Git presentationGit presentation
Git presentation
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git for Beginners
Git for BeginnersGit for Beginners
Git for Beginners
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 

Introduction to Git

  • 1. Introduction to Git 10/2/2013 Rick Umali rickumali@gmail.com @rickumali http://tech.rickumali.com/ This presentation is on Google Drive at: http://sn.im/git-talk-2013 There you can read the 'speaker notes' for this presentation.
  • 2. What is Source Control? Source code control is the most important practice a coding professional can do. A mechanism to track changes in source code. Used for version history, auditing, and recovery.
  • 4. Revision Control Example: Git You’ll learn how to make a repository like this.
  • 5. Git Git is an open source, distributed version control system designed for speed and efficiency. Freedom No "server" required Unique architecture
  • 7. Our Example: A Basic Drupal Module
  • 8. Creating a Repository % cd web/sites/all/modules % mkdir dumpstamp % cd dumpstamp % git init "git init" creates the entire Git repository. No server interaction required!
  • 9. Committing Your First File To 'commit' means 'to save the state' of your work. You must first 'add' this change to the 'staging area'. % vi README.txt % git add README.txt % git commit -m "First commit. README file." Commit often!
  • 10. Looking at the Repository History % git log % gitk
  • 11. Adding More Files % vi dumpstamp.info dumpstamp.module % git status % git add . % git commit or % git commit -a -m “My commit message.” Learn the shortcuts by reading Git docs.
  • 12. Examining Changes to Files % vi dumpstamp.module % git status % git diff % git add dumpstamp.module % git commit % git log Become familiar with Git status and diff output. Make your commit messages meaningful!
  • 13. Looking at the Log Again The history can be examined different ways. % git log --format=short % git log --format=oneline % git log --oneline
  • 14. Revisiting History You can 'revisit' any point of your history. % git checkout SHA_ID Checkout makes the working directory match the state of the specific SHA_ID. This is a time machine!
  • 15. Returning to the Present At all times, Git retains a pointer to the ‘present’. % git checkout master
  • 16. Branching and Merging Next, But... What we have covered so far is probably 70- 80% of what you will do with git. Adding and committing files are the heart of git (and any version control system).
  • 17. Git encourages experimentation, by making branching very easy! Branching
  • 18. Branching: git branch % git branch BRANCH % git checkout BRANCH This makes a branch from “where you currently are”, and then “switches” (checks out) the branch. “git branch” tells you what branch you’re on.
  • 19. Branching: Starting State SHA 1Amaster NOTE: 'master' is a branch that's created 'by default'.
  • 20. Branching: Make Some Changes SHA 1A SHA 2Bmaster git commit
  • 21. Branching: Making a Branch SHA 1A SHA 2Bmaster branch1 git branch branch1 git checkout branch1 OR git checkout -b branch1
  • 22. Branching: Changes on the Branch SHA 1A SHA 2Bmaster SHA 3C (Make changes in "branch1".) git commit branch1
  • 23. Branching: Making a New Branch SHA 1A SHA 2Bmaster SHA 3C git checkout master git checkout -b branch2 branch1 branch2
  • 24. Branching: Changes on another Branch SHA 1A SHA 2Bmaster branch2SHA 4D (Make changes in "branch2".) git commit branch1 SHA 3C
  • 26. Merging Bringing two branches together. First 'checkout' the branch you want to merge into (typically master), then 'merge' in branch. % git checkout master % git merge BRANCH
  • 27. Merging: Starting State SHA 1A SHA 2Bmaster branch2SHA 4Dbranch1 SHA 3C
  • 28. Merging: Fast-Forward Merge git checkout master git merge branch1 SHA 1A SHA 2B branch2SHA 4Cmaster, branch1 SHA 3C
  • 29. Merging: Resolving Conflicts git merge branch2 SHA 1A SHA 2B branch2SHA 4Cbranch1 SHA 3C SHA 5 master
  • 30. Merging: The Hard Part Manual 'merging' may be required.
  • 32. Whew!
  • 33. Using Git “Remotely” You can upload your local Git repository to a public Git repository. These repositories are known as remotes. Using “remotes” is the key to collaborating.
  • 34. Visualizing Remotes Your Repo Bob Repo GitHub Repo
  • 35. Uploading New Code to GitHub Create a repository (on GitHub). Add a 'remote' (via git remote add). Upload your code (via git push).
  • 37. Adding a Remote git remote adds a name for a repo at a specific URL git remote add origin git@github.com:rickumali/DumpStamp. git Your Repo GitHub Repo (origin) Dumpstamp.git This is just a naming step!
  • 38. Push Your Repo to the Remote % git push -u origin master
  • 39. Visualizing the Push git push uploads the repository to the remote Your Repo GitHub Repo (origin)
  • 40. Visualizing Remotes (cloning) Your Repo Bob Repo GitHub Repo (origin) Now Bob can ‘clone’ your repository clone
  • 43. The Cycle with Remotes Your Repo Bob Repo GitHub Repo (origin) You Push, Bob “Pulls” (or Fetches/Merges) pullpush
  • 44. You Saw and Learned A Lot About Git Typical Git Commands Add, Commit, Log, Diff, Status Branch and Merging Git Remote Repositories
  • 45. Next Steps Install Git Commit frequently and log verbosely Experiment (branch) often
  • 46. Introduction to Git 10/2/2013 Rick Umali rickumali@gmail.com @rickumali http://tech.rickumali.com/ This presentation is on Google Drive at: http://sn.im/git-talk-2013 There you can read the 'speaker notes' for this presentation.
  • 47. Resources http://sethrobertson.github.io/GitBestPractices/ Great list of Git best practices. http://git-scm.org/ Both "Pro Git" book, and Git reference http://gitref.org/ A "quicker" Git reference http://www-cs-students.stanford.edu/~blynn/gitmagic/ "Friendlier" Git walk-through (git magic). http://www.mail-archive.com/dri-devel@lists. sourceforge.net/msg39091.html Linus on "clean history."
  • 48. Resources http://www.youtube.com/watch?v=4XpnKHJAok8 Linus Torvalds (Git creator) (May '07) http://www.youtube.com/watch?v=8dhZ9BXQgc4 Randal Schwartz (Perl expert and Git old-timer) (Oct '07) http://www.youtube.com/watch?v=ZDR433b0HJY Scott Chacon (Pro Git author) (July '11)