SlideShare a Scribd company logo
1 of 50
Intro to GitIntro to Git
Carl BrownCarl Brown
SVN has one masterSVN has one master
Nothing happens in subversion-land without checking with theNothing happens in subversion-land without checking with the
master firstmaster first
Clients are second-class denizensClients are second-class denizens
This is SlowThis is Slow
Limits options because of global lockingLimits options because of global locking
Forces Lowest-Common-Demoninator features because mistakes areForces Lowest-Common-Demoninator features because mistakes are
public and fatalpublic and fatal
All GIT repos are equalAll GIT repos are equal
A "master repo" is a policy decision, not a technical oneA "master repo" is a policy decision, not a technical one
Much fasterMuch faster
More feature-richMore feature-rich
Can perform complex operations without locking all other users outCan perform complex operations without locking all other users out
for an extended timefor an extended time
Allows more risk because you can only hurt yourselfAllows more risk because you can only hurt yourself
Git ConceptsGit Concepts
A "commit"A "commit"
Just a diff file plus someJust a diff file plus some
metadatametadata
Basic unit of work in gitBasic unit of work in git
Commits in git are identifiedCommits in git are identified
by fingerprintby fingerprint
SHA-1 hashSHA-1 hash
If anything in the commitIf anything in the commit
changes, then SHA changes, sochanges, then SHA changes, so
it’s a new commit (Q.E.D.it’s a new commit (Q.E.D.
commits are immutable)commits are immutable)
You can usually use only theYou can usually use only the
first few characters, as long asfirst few characters, as long as
they're uniquethey're unique
Removes need forRemoves need for
authoritative server source forauthoritative server source for
issuing IDsissuing IDs
Identifies corrupted commitsIdentifies corrupted commits
All git commits contain theirAll git commits contain their
parents IDsparents IDs
So you can trace from anySo you can trace from any
commit back to the verycommit back to the very
first commitfirst commit
Changing the order ofChanging the order of
commits isn't possiblecommits isn't possible
without changing thewithout changing the
commit IDscommit IDs
Commits don't know theirCommits don't know their
children though (notchildren though (not
known when they'reknown when they're
created)created)
Branches and tagsBranches and tags
Just pointersJust pointers
If you point at a single commit, youIf you point at a single commit, you
specify the entire history of the commitspecify the entire history of the commit
This makes branching a trivial operationThis makes branching a trivial operation
A single commit can be the HEAD ofA single commit can be the HEAD of
dozens of branchesdozens of branches
Branch early and oftenBranch early and often
Prolific branches allow git merges to beProlific branches allow git merges to be
explicit instead of implicit (like 'svnexplicit instead of implicit (like 'svn
update' is implicit)update' is implicit)
my “foo” branch may point to a differentmy “foo” branch may point to a different
commit than your “foo” branch, but allcommit than your “foo” branch, but all
“foobar” tags have to point to the exact“foobar” tags have to point to the exact
same commitsame commit
““HEAD”HEAD”
The tip commit ofThe tip commit of
whatever branch you’rewhatever branch you’re
currently working with orcurrently working with or
talking abouttalking about
Although you can useAlthough you can use
“HEAD” in any place that“HEAD” in any place that
would normally take awould normally take a
branch name, if it’s in anybranch name, if it’s in any
way ambiguous, even inway ambiguous, even in
your mind, use the branchyour mind, use the branch
name insteadname instead
"origin""origin"
This is a convention in git asThis is a convention in git as
an alias for the repo youran alias for the repo your
repository was cloned fromrepository was cloned from
While this is often theWhile this is often the
organization’s authoritativeorganization’s authoritative
server, it isn’t alwaysserver, it isn’t always
It’s just an alias for a URL in aIt’s just an alias for a URL in a
config fileconfig file
If you clone from Mark, and IIf you clone from Mark, and I
clone from you, then yourclone from you, then your
repo’s “origin” points at Mark’srepo’s “origin” points at Mark’s
repo, but my “origin” points atrepo, but my “origin” points at
your repoyour repo
"master""master"
This a convention in git for aThis a convention in git for a
"trunk" like branch."trunk" like branch.
Some commands may break if itSome commands may break if it
doesn't existdoesn't exist
What you use it for is a policyWhat you use it for is a policy
matter, not a technological onematter, not a technological one
In Studio, origin/master is alwaysIn Studio, origin/master is always
“the thing QA released most“the thing QA released most
recently”recently”
Your local master can be whateverYour local master can be whatever
Pick something that isn’t likely toPick something that isn’t likely to
confuse you, thoughconfuse you, though
““origin master”origin master”
(used in “push” and “pull” commands)(used in “push” and “pull” commands)
(used in “push” and “pull” commands)(used in “push” and “pull” commands)
That tree - way over thereThat tree - way over there
The default branch of theThe default branch of the
repo you cloned fromrepo you cloned from
replace “origin” with anyreplace “origin” with any
repo name and “master”repo name and “master”
with any branch namewith any branch name
““origin/master”origin/master”
(“merge”,“reset” & “branch” commands)(“merge”,“reset” & “branch” commands)
(“merge”,“reset” & “branch” commands)(“merge”,“reset” & “branch” commands)
A pointer to the commitA pointer to the commit
that was the HEAD of thethat was the HEAD of the
default branch of the repodefault branch of the repo
you cloned from AS OFyou cloned from AS OF
THE LAST TIMEYOUTHE LAST TIMEYOU
FETCHED FROM THATFETCHED FROM THAT
REPO.REPO.
A picture of a tree is not aA picture of a tree is not a
treetree
"index""index"
(also called "cache" but really(also called "cache" but really "staging area""staging area"))
))
Place where changes getPlace where changes get
put when you're preparingput when you're preparing
for a commitfor a commit
““working set” orworking set” or
“working directory”“working directory”
““working directory”working directory”
The files in the directoryThe files in the directory
that you are in the processthat you are in the process
of browsing, editing,of browsing, editing,
compiling, running and/orcompiling, running and/or
testingtesting
The set of source codeThe set of source code
files that Windowsfiles that Windows
Explorer displaysExplorer displays
Interacting with otherInteracting with other
reposrepos
Most git commandsMost git commands
affect only youaffect only you
Except for:Except for:
PushPush
PullPull
FetchFetch
CloneClone
(SVN/CVS/etc.)(SVN/CVS/etc.)
Obscure plumbingObscure plumbing
git clonegit clone
Creates a new repositoryCreates a new repository
on your local machineon your local machine
The new repo is a copy ofThe new repo is a copy of
the repository you clonedthe repository you cloned
fromfrom
The alias “origin” isThe alias “origin” is
assigned in your new localassigned in your new local
repo to point to the onerepo to point to the one
you cloned fromyou cloned from
git fetchgit fetch
Gets all changes from remoteGets all changes from remote
reporepo
Puts those changes in yourPuts those changes in your
local repolocal repo
Does not affect your workingDoes not affect your working
tree or staging areatree or staging area
Should not be any way youShould not be any way you
can get a conflict herecan get a conflict here
If there is a conflict, someoneIf there is a conflict, someone
did something unwisedid something unwise
git pullgit pull
'git fetch' plus 'git merge' in one "easier'git fetch' plus 'git merge' in one "easier
to type" command lineto type" command line
I don’t use this, I recommend you don’tI don’t use this, I recommend you don’t
eithereither
NEVER pull without specifying a repoNEVER pull without specifying a repo
and branch, or git will "guess"and branch, or git will "guess"
You wouldn't merge from "whereverYou wouldn't merge from "wherever
the source control software feels like",the source control software feels like",
you shouldn't pull that way eitheryou shouldn't pull that way either
Don’t pull it if you don’t know youDon’t pull it if you don’t know you
want to be stuck with itwant to be stuck with it
prefer “fetch + merge” if you haveprefer “fetch + merge” if you have
changes or “fetch + reset” if you don’tchanges or “fetch + reset” if you don’t
git pushgit push
Take all changes associated with theTake all changes associated with the
specified branch and give thespecified branch and give the
specified remote server any of themspecified remote server any of them
it is missingit is missing
If someone else doesn’t see yourIf someone else doesn’t see your
changes, you forgot to do thischanges, you forgot to do this
Always specify remote alias andAlways specify remote alias and
branchbranch
Like with the "pull" command, youLike with the "pull" command, you
shouldn’t let the software "guess"shouldn’t let the software "guess"
opposite of fetch (NOT the oppositeopposite of fetch (NOT the opposite
of pull)of pull)
never push to a repo that contains anever push to a repo that contains a
working directoryworking directory
Working in your repoWorking in your repo
git addgit add
Puts changes into thePuts changes into the
“staging area”“staging area”
git commitgit commit
puts staged changes intoputs staged changes into
the local repositorythe local repository
I try to do this every timeI try to do this every time
I compileI compile
When in any doubt,When in any doubt,
commit first!commit first!
git statusgit status
Shows changes in yourShows changes in your
working directory andworking directory and
staging areastaging area
git loggit log
Shows you the history ofShows you the history of
where you arewhere you are
Usually, this is the place toUsually, this is the place to
use a GUI instead, thoughuse a GUI instead, though
How did I get here?How did I get here?
git checkoutgit checkout
Put the files in yourPut the files in your
working directory in aworking directory in a
known stateknown state
Almost alwaysAlmost always
corresponding to acorresponding to a
particular local branchparticular local branch
You can use the ‘-b’ flag toYou can use the ‘-b’ flag to
checkout to make a newcheckout to make a new
local branch and switchlocal branch and switch
your working directory toyour working directory to
it at the same timeit at the same time
git branchgit branch
Make a new (local) branchMake a new (local) branch
List existing (local orList existing (local or
cached) branchescached) branches
Delete a (local) branchDelete a (local) branch
git reset /git reset /
git cleangit clean
git cleangit cleanremove changes youremove changes you
(hopefully) don’t want from(hopefully) don’t want from
your wayyour way
puts the working directoryputs the working directory
and/or the staging area back inand/or the staging area back in
a known statea known state
I use this a lot to sync up to aI use this a lot to sync up to a
branch I don’t have changes inbranch I don’t have changes in
This can lose data - BEThis can lose data - BE
CAREFUL!!CAREFUL!!
When in any doubt, commitWhen in any doubt, commit
first!first!
git mergegit merge
merge 2 or more branchesmerge 2 or more branches
uses 3-way mergesuses 3-way merges
works REALLY wellworks REALLY well
any merge info will get lost ifany merge info will get lost if
you push the result to SVNyou push the result to SVN
No tool substitutes for aNo tool substitutes for a
lack of coordination!lack of coordination!
git mergetool helps with thisgit mergetool helps with this
git rebasegit rebase
rearrange commitsrearrange commits
(illustration coming up(illustration coming up
later)later)
do NOT do this ifdo NOT do this if
someone else is sharingsomeone else is sharing
your changesyour changes
do NOT share changes ifdo NOT share changes if
you’re going to do thisyou’re going to do this
git helpgit help
fairly thorough, but oftenfairly thorough, but often
dense documentationdense documentation
Other resources:Other resources:
http://git.or.cz/course/svn.htmlhttp://git.or.cz/course/svn.html
http://utsl.gen.nz/talks/gihttp://utsl.gen.nz/talks/gi
t-svn/intro.htmlt-svn/intro.html
Some things you probablySome things you probably
shouldn’t doshouldn’t do
‘‘git revert’ probablygit revert’ probably
doesn’t do what you thinkdoesn’t do what you think
if you do have to use it,if you do have to use it,
clean up after yourselfclean up after yourself
as soon as you canas soon as you can
git push -fgit push -f
if you think you need toif you think you need to
do this - something baddo this - something bad
hopefully happened.hopefully happened.
Should not be routine.Should not be routine.
Everyday workflowEveryday workflow
Pro Tips and BestPro Tips and Best
PracticesPractices
commit as often as you build/compilecommit as often as you build/compile
a good commit diff, like a good method, should fit on your screena good commit diff, like a good method, should fit on your screen
don’t worry if it’s not good enough (no one can see it until you push)don’t worry if it’s not good enough (no one can see it until you push)
you might want to get back here (the next thing you do might break)you might want to get back here (the next thing you do might break)
you can always squash lateryou can always squash later
push when you would have committed in cvs/svnpush when you would have committed in cvs/svn
only push when you won’t “break the build” or when tests passonly push when you won’t “break the build” or when tests pass
don’t forget to push when you want other people to see your workdon’t forget to push when you want other people to see your work
branch for every complete functional set/bug fix/featurebranch for every complete functional set/bug fix/feature
keeping functionality separate makes life easier laterkeeping functionality separate makes life easier later
feel free to branch retroactively (but not what svn means by that)feel free to branch retroactively (but not what svn means by that)
Simplified Dev WorkflowSimplified Dev Workflow
(For Larger Teams)(For Larger Teams)
(For Larger Teams)(For Larger Teams)
Get latestGet latest
git fetch origingit fetch origin
Create a new branch for each bug or featureCreate a new branch for each bug or feature
git checkout -b ${feature} origin/${oldbranch}git checkout -b ${feature} origin/${oldbranch}
Make your changes as beforeMake your changes as before
(hopefully committing more often)(hopefully committing more often)
Check inYour Changes LocallyCheck inYour Changes Locally
git commit -am “An Intelligent Comment”git commit -am “An Intelligent Comment”
Push changes back where others can find themPush changes back where others can find them
git push origin ${feature}git push origin ${feature}
Later, merge feature branches together to make Release CandidatesLater, merge feature branches together to make Release Candidates
Making ReleaseMaking Release
Candidate BranchesCandidate Branches
Three Different CombiningThree Different Combining
OptionsOptions
MergeMerge
Keeps HistoryKeeps History
Should Use --no-ffShould Use --no-ff
Harder to trace later in logsHarder to trace later in logs
RebaseRebase
Simplifies History in LogsSimplifies History in Logs
Better for things withoutBetter for things without
common recent parentcommon recent parent
Loses some history infoLoses some history info
Cherry-PickCherry-Pick
Just like rebase but for singleJust like rebase but for single
commitscommits
MergingMerging
““git checkout ${destinationgit checkout ${destination
branch}”branch}”
““git merge ${feature branch}”git merge ${feature branch}”
““git mergetool” if conflictsgit mergetool” if conflicts
““git checkout --ours” orgit checkout --ours” or
“git checkout --theirs” if“git checkout --theirs” if
you want to pick oneyou want to pick one
““git merge ${second featuregit merge ${second feature
branch}”branch}”
RebaseRebase
““git checkout ${feature branch}”git checkout ${feature branch}”
““git checkout -b ${new name}”git checkout -b ${new name}”
to copyto copy
““git rebase ${destinationgit rebase ${destination
branch}”branch}”
if you want every commitif you want every commit
back to common point, orback to common point, or
““git rebase --ontogit rebase --onto
${destination branch}${destination branch}
${last commit not to take}${last commit not to take}
${feature branch}”${feature branch}”
If you want a subsetIf you want a subset
Rebasing ExampleRebasing Example
initial stateinitial state
Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9serverserverserverserver
clientclientclientclient
Rebasing ExampleRebasing Example
git checkout servergit checkout server
git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9serverserverserverserver
clientclientclientclient
C3C3C3C3 C4C4C4C4 C7C7C7C7
Rebasing ExampleRebasing Example
git checkout servergit checkout server
git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9
serverserverserverserver
clientclientclientclient
C3C3C3C3 C4C4C4C4 C7C7C7C7
Rebasing ExampleRebasing Example
git checkout servergit checkout server
git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9
serverserverserverserver
clientclientclientclient
C3’C3’C3’C3’ C4’C4’C4’C4’ C7’C7’C7’C7’
Rebasing ExampleRebasing Example
initial stateinitial state
Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9serverserverserverserver
clientclientclientclient
Rebasing ExampleRebasing Example
git rebase --onto master server clientgit rebase --onto master server client
Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9serverserverserverserver
clientclientclientclient
Rebasing ExampleRebasing Example
git rebase --onto master server clientgit rebase --onto master server client
Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8C8C8C8 C9C9C9C9
serverserverserverserver
clientclientclientclient
Rebasing ExampleRebasing Example
git rebase --onto master server clientgit rebase --onto master server client
Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon
C1C1C1C1
mastemaste
rr
mastemaste
rr
C2C2C2C2 C5C5C5C5 C6C6C6C6
C3C3C3C3 C4C4C4C4 C7C7C7C7
C8’C8’C8’C8’ C9’C9’C9’C9’
serverserverserverserver
clientclientclientclient
Staying current with SVNStaying current with SVN
git svn fetchgit svn fetch
Doesn’t update workingDoesn’t update working
tree, but gets branchestree, but gets branches
git svn rebasegit svn rebase
puts SVN revision IDs inputs SVN revision IDs in
git commentsgit comments
have to do this to stay inhave to do this to stay in
syncsync
Loses git history, so makeLoses git history, so make
copied branches in git firstcopied branches in git first
Pushing back to SVNPushing back to SVN
git svn dcommitgit svn dcommit
simplest and safest on SVN sidesimplest and safest on SVN side
requires you rebase in latest SVNrequires you rebase in latest SVN
changeschanges
Make a copied branch in git to doMake a copied branch in git to do
this onthis on
May be preceded by “git resetMay be preceded by “git reset
--hard $git_branch”--hard $git_branch”
git svn set-treegit svn set-tree
Overwrites SVN ignorantly (withOverwrites SVN ignorantly (with
extreme prejudice)extreme prejudice)
nuking the site from Orbitnuking the site from Orbit

More Related Content

What's hot

Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to gitEmanuele Olivetti
 
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 GitE Carter
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
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 GitGeoff Hoffman
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Git Terminologies
Git TerminologiesGit Terminologies
Git TerminologiesYash
 

What's hot (20)

Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
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
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
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+github
Git+githubGit+github
Git+github
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Git commands
Git commandsGit commands
Git commands
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 

Viewers also liked

Creating Custom Drupal Modules
Creating Custom Drupal ModulesCreating Custom Drupal Modules
Creating Custom Drupal Modulestanoshimi
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesMichel Alves
 
FLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesFLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesMichel Alves
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsMichel Alves
 
Manipulating file in Python
Manipulating file in PythonManipulating file in Python
Manipulating file in Pythonshoukatali500
 
Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Peter Kofler
 
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...Alessandro Molina
 
FLTK Summer Course - Part VII - Seventh Impact
FLTK Summer Course - Part VII  - Seventh ImpactFLTK Summer Course - Part VII  - Seventh Impact
FLTK Summer Course - Part VII - Seventh ImpactMichel Alves
 
Using Git on the Command Line
Using Git on the Command LineUsing Git on the Command Line
Using Git on the Command LineBrian Richards
 
FLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactFLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactMichel Alves
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Anil Sagar
 
"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development processPolished Geek LLC
 
FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises Michel Alves
 
FLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactFLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactMichel Alves
 
FLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactFLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactMichel Alves
 
Git hooks For PHP Developers
Git hooks For PHP DevelopersGit hooks For PHP Developers
Git hooks For PHP DevelopersUmut IŞIK
 
Servicios web con Python
Servicios web con PythonServicios web con Python
Servicios web con PythonManuel Pérez
 
Internal Anatomy of an Update
Internal Anatomy of an UpdateInternal Anatomy of an Update
Internal Anatomy of an UpdateMongoDB
 
Minimal standard c program
Minimal standard c programMinimal standard c program
Minimal standard c programSwain Loda
 

Viewers also liked (20)

Creating Custom Drupal Modules
Creating Custom Drupal ModulesCreating Custom Drupal Modules
Creating Custom Drupal Modules
 
FLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - ExercisesFLTK Summer Course - Part VI - Sixth Impact - Exercises
FLTK Summer Course - Part VI - Sixth Impact - Exercises
 
FLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - ExercisesFLTK Summer Course - Part I - First Impact - Exercises
FLTK Summer Course - Part I - First Impact - Exercises
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and Reports
 
Manipulating file in Python
Manipulating file in PythonManipulating file in Python
Manipulating file in Python
 
Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)Code Refactoring - Live Coding Demo (JavaDay 2014)
Code Refactoring - Live Coding Demo (JavaDay 2014)
 
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
EuroPython 2013 - FAST, DOCUMENTED AND RELIABLE JSON BASED WEBSERVICES WITH P...
 
FLTK Summer Course - Part VII - Seventh Impact
FLTK Summer Course - Part VII  - Seventh ImpactFLTK Summer Course - Part VII  - Seventh Impact
FLTK Summer Course - Part VII - Seventh Impact
 
Using Git on the Command Line
Using Git on the Command LineUsing Git on the Command Line
Using Git on the Command Line
 
FLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second ImpactFLTK Summer Course - Part II - Second Impact
FLTK Summer Course - Part II - Second Impact
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process"Git Hooked!" Using Git hooks to improve your software development process
"Git Hooked!" Using Git hooks to improve your software development process
 
FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises FLTK Summer Course - Part II - Second Impact - Exercises
FLTK Summer Course - Part II - Second Impact - Exercises
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
FLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth ImpactFLTK Summer Course - Part VIII - Eighth Impact
FLTK Summer Course - Part VIII - Eighth Impact
 
FLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third ImpactFLTK Summer Course - Part III - Third Impact
FLTK Summer Course - Part III - Third Impact
 
Git hooks For PHP Developers
Git hooks For PHP DevelopersGit hooks For PHP Developers
Git hooks For PHP Developers
 
Servicios web con Python
Servicios web con PythonServicios web con Python
Servicios web con Python
 
Internal Anatomy of an Update
Internal Anatomy of an UpdateInternal Anatomy of an Update
Internal Anatomy of an Update
 
Minimal standard c program
Minimal standard c programMinimal standard c program
Minimal standard c program
 

Similar to Introduction to Git Commands and Concepts

Similar to Introduction to Git Commands and Concepts (20)

Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Git meanings of -distributed-
Git  meanings of -distributed-Git  meanings of -distributed-
Git meanings of -distributed-
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Git
GitGit
Git
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
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
 
Hello git
Hello git Hello git
Hello git
 
Git training
Git trainingGit training
Git training
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Git
GitGit
Git
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git
GitGit
Git
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Writing Rust Command Line Applications
Writing Rust Command Line ApplicationsWriting Rust Command Line Applications
Writing Rust Command Line Applications
 

More from Carl Brown

GDPR, User Data, Privacy, and Your Apps
GDPR, User Data, Privacy, and Your AppsGDPR, User Data, Privacy, and Your Apps
GDPR, User Data, Privacy, and Your AppsCarl Brown
 
New in iOS 11.3b4 and Xcode 9.3b4
New in iOS 11.3b4 and Xcode 9.3b4New in iOS 11.3b4 and Xcode 9.3b4
New in iOS 11.3b4 and Xcode 9.3b4Carl Brown
 
Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Carl Brown
 
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Carl Brown
 
Generics, the Swift ABI and you
Generics, the Swift ABI and youGenerics, the Swift ABI and you
Generics, the Swift ABI and youCarl Brown
 
Swift GUI Development without Xcode
Swift GUI Development without XcodeSwift GUI Development without Xcode
Swift GUI Development without XcodeCarl Brown
 
what's new in iOS10 2016-06-23
what's new in iOS10 2016-06-23what's new in iOS10 2016-06-23
what's new in iOS10 2016-06-23Carl Brown
 
Open Source Swift: Up and Running
Open Source Swift: Up and RunningOpen Source Swift: Up and Running
Open Source Swift: Up and RunningCarl Brown
 
Parse migration CocoaCoders April 28th, 2016
Parse migration CocoaCoders April 28th, 2016Parse migration CocoaCoders April 28th, 2016
Parse migration CocoaCoders April 28th, 2016Carl Brown
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Carl Brown
 
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...Carl Brown
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watchCarl Brown
 
iOS8 and the new App Store
iOS8 and the new App Store   iOS8 and the new App Store
iOS8 and the new App Store Carl Brown
 
Dark Art of Software Estimation 360iDev2014
Dark Art of Software Estimation 360iDev2014Dark Art of Software Estimation 360iDev2014
Dark Art of Software Estimation 360iDev2014Carl Brown
 
Intro to cloud kit Cocoader.org 24 July 2014
Intro to cloud kit   Cocoader.org 24 July 2014Intro to cloud kit   Cocoader.org 24 July 2014
Intro to cloud kit Cocoader.org 24 July 2014Carl Brown
 
Welcome to Swift (CocoaCoder 6/12/14)
Welcome to Swift (CocoaCoder 6/12/14)Welcome to Swift (CocoaCoder 6/12/14)
Welcome to Swift (CocoaCoder 6/12/14)Carl Brown
 
Writing Apps that Can See: Getting Data from CoreImage to Computer Vision - ...
Writing Apps that Can See: Getting Data from CoreImage to Computer  Vision - ...Writing Apps that Can See: Getting Data from CoreImage to Computer  Vision - ...
Writing Apps that Can See: Getting Data from CoreImage to Computer Vision - ...Carl Brown
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourCarl Brown
 
360iDev iOS AntiPatterns
360iDev iOS AntiPatterns360iDev iOS AntiPatterns
360iDev iOS AntiPatternsCarl Brown
 

More from Carl Brown (20)

GDPR, User Data, Privacy, and Your Apps
GDPR, User Data, Privacy, and Your AppsGDPR, User Data, Privacy, and Your Apps
GDPR, User Data, Privacy, and Your Apps
 
New in iOS 11.3b4 and Xcode 9.3b4
New in iOS 11.3b4 and Xcode 9.3b4New in iOS 11.3b4 and Xcode 9.3b4
New in iOS 11.3b4 and Xcode 9.3b4
 
Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)
 
Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06Better Swift from the Foundation up #tryswiftnyc17 09-06
Better Swift from the Foundation up #tryswiftnyc17 09-06
 
Generics, the Swift ABI and you
Generics, the Swift ABI and youGenerics, the Swift ABI and you
Generics, the Swift ABI and you
 
Swift GUI Development without Xcode
Swift GUI Development without XcodeSwift GUI Development without Xcode
Swift GUI Development without Xcode
 
what's new in iOS10 2016-06-23
what's new in iOS10 2016-06-23what's new in iOS10 2016-06-23
what's new in iOS10 2016-06-23
 
Open Source Swift: Up and Running
Open Source Swift: Up and RunningOpen Source Swift: Up and Running
Open Source Swift: Up and Running
 
Parse migration CocoaCoders April 28th, 2016
Parse migration CocoaCoders April 28th, 2016Parse migration CocoaCoders April 28th, 2016
Parse migration CocoaCoders April 28th, 2016
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016
 
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...
Advanced, Composable Collection Views, From CocoaCoders meetup Austin Feb 12,...
 
Gcd cc-150205
Gcd cc-150205Gcd cc-150205
Gcd cc-150205
 
Cocoa coders 141113-watch
Cocoa coders 141113-watchCocoa coders 141113-watch
Cocoa coders 141113-watch
 
iOS8 and the new App Store
iOS8 and the new App Store   iOS8 and the new App Store
iOS8 and the new App Store
 
Dark Art of Software Estimation 360iDev2014
Dark Art of Software Estimation 360iDev2014Dark Art of Software Estimation 360iDev2014
Dark Art of Software Estimation 360iDev2014
 
Intro to cloud kit Cocoader.org 24 July 2014
Intro to cloud kit   Cocoader.org 24 July 2014Intro to cloud kit   Cocoader.org 24 July 2014
Intro to cloud kit Cocoader.org 24 July 2014
 
Welcome to Swift (CocoaCoder 6/12/14)
Welcome to Swift (CocoaCoder 6/12/14)Welcome to Swift (CocoaCoder 6/12/14)
Welcome to Swift (CocoaCoder 6/12/14)
 
Writing Apps that Can See: Getting Data from CoreImage to Computer Vision - ...
Writing Apps that Can See: Getting Data from CoreImage to Computer  Vision - ...Writing Apps that Can See: Getting Data from CoreImage to Computer  Vision - ...
Writing Apps that Can See: Getting Data from CoreImage to Computer Vision - ...
 
REST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A TourREST/JSON/CoreData Example Code - A Tour
REST/JSON/CoreData Example Code - A Tour
 
360iDev iOS AntiPatterns
360iDev iOS AntiPatterns360iDev iOS AntiPatterns
360iDev iOS AntiPatterns
 

Recently uploaded

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Introduction to Git Commands and Concepts

  • 1. Intro to GitIntro to Git Carl BrownCarl Brown
  • 2. SVN has one masterSVN has one master Nothing happens in subversion-land without checking with theNothing happens in subversion-land without checking with the master firstmaster first Clients are second-class denizensClients are second-class denizens This is SlowThis is Slow Limits options because of global lockingLimits options because of global locking Forces Lowest-Common-Demoninator features because mistakes areForces Lowest-Common-Demoninator features because mistakes are public and fatalpublic and fatal
  • 3. All GIT repos are equalAll GIT repos are equal A "master repo" is a policy decision, not a technical oneA "master repo" is a policy decision, not a technical one Much fasterMuch faster More feature-richMore feature-rich Can perform complex operations without locking all other users outCan perform complex operations without locking all other users out for an extended timefor an extended time Allows more risk because you can only hurt yourselfAllows more risk because you can only hurt yourself
  • 5. A "commit"A "commit" Just a diff file plus someJust a diff file plus some metadatametadata Basic unit of work in gitBasic unit of work in git
  • 6. Commits in git are identifiedCommits in git are identified by fingerprintby fingerprint SHA-1 hashSHA-1 hash If anything in the commitIf anything in the commit changes, then SHA changes, sochanges, then SHA changes, so it’s a new commit (Q.E.D.it’s a new commit (Q.E.D. commits are immutable)commits are immutable) You can usually use only theYou can usually use only the first few characters, as long asfirst few characters, as long as they're uniquethey're unique Removes need forRemoves need for authoritative server source forauthoritative server source for issuing IDsissuing IDs Identifies corrupted commitsIdentifies corrupted commits
  • 7. All git commits contain theirAll git commits contain their parents IDsparents IDs So you can trace from anySo you can trace from any commit back to the verycommit back to the very first commitfirst commit Changing the order ofChanging the order of commits isn't possiblecommits isn't possible without changing thewithout changing the commit IDscommit IDs Commits don't know theirCommits don't know their children though (notchildren though (not known when they'reknown when they're created)created)
  • 8. Branches and tagsBranches and tags Just pointersJust pointers If you point at a single commit, youIf you point at a single commit, you specify the entire history of the commitspecify the entire history of the commit This makes branching a trivial operationThis makes branching a trivial operation A single commit can be the HEAD ofA single commit can be the HEAD of dozens of branchesdozens of branches Branch early and oftenBranch early and often Prolific branches allow git merges to beProlific branches allow git merges to be explicit instead of implicit (like 'svnexplicit instead of implicit (like 'svn update' is implicit)update' is implicit) my “foo” branch may point to a differentmy “foo” branch may point to a different commit than your “foo” branch, but allcommit than your “foo” branch, but all “foobar” tags have to point to the exact“foobar” tags have to point to the exact same commitsame commit
  • 9. ““HEAD”HEAD” The tip commit ofThe tip commit of whatever branch you’rewhatever branch you’re currently working with orcurrently working with or talking abouttalking about Although you can useAlthough you can use “HEAD” in any place that“HEAD” in any place that would normally take awould normally take a branch name, if it’s in anybranch name, if it’s in any way ambiguous, even inway ambiguous, even in your mind, use the branchyour mind, use the branch name insteadname instead
  • 10. "origin""origin" This is a convention in git asThis is a convention in git as an alias for the repo youran alias for the repo your repository was cloned fromrepository was cloned from While this is often theWhile this is often the organization’s authoritativeorganization’s authoritative server, it isn’t alwaysserver, it isn’t always It’s just an alias for a URL in aIt’s just an alias for a URL in a config fileconfig file If you clone from Mark, and IIf you clone from Mark, and I clone from you, then yourclone from you, then your repo’s “origin” points at Mark’srepo’s “origin” points at Mark’s repo, but my “origin” points atrepo, but my “origin” points at your repoyour repo
  • 11. "master""master" This a convention in git for aThis a convention in git for a "trunk" like branch."trunk" like branch. Some commands may break if itSome commands may break if it doesn't existdoesn't exist What you use it for is a policyWhat you use it for is a policy matter, not a technological onematter, not a technological one In Studio, origin/master is alwaysIn Studio, origin/master is always “the thing QA released most“the thing QA released most recently”recently” Your local master can be whateverYour local master can be whatever Pick something that isn’t likely toPick something that isn’t likely to confuse you, thoughconfuse you, though
  • 12. ““origin master”origin master” (used in “push” and “pull” commands)(used in “push” and “pull” commands) (used in “push” and “pull” commands)(used in “push” and “pull” commands) That tree - way over thereThat tree - way over there The default branch of theThe default branch of the repo you cloned fromrepo you cloned from replace “origin” with anyreplace “origin” with any repo name and “master”repo name and “master” with any branch namewith any branch name
  • 13. ““origin/master”origin/master” (“merge”,“reset” & “branch” commands)(“merge”,“reset” & “branch” commands) (“merge”,“reset” & “branch” commands)(“merge”,“reset” & “branch” commands) A pointer to the commitA pointer to the commit that was the HEAD of thethat was the HEAD of the default branch of the repodefault branch of the repo you cloned from AS OFyou cloned from AS OF THE LAST TIMEYOUTHE LAST TIMEYOU FETCHED FROM THATFETCHED FROM THAT REPO.REPO. A picture of a tree is not aA picture of a tree is not a treetree
  • 14. "index""index" (also called "cache" but really(also called "cache" but really "staging area""staging area")) )) Place where changes getPlace where changes get put when you're preparingput when you're preparing for a commitfor a commit
  • 15. ““working set” orworking set” or “working directory”“working directory” ““working directory”working directory” The files in the directoryThe files in the directory that you are in the processthat you are in the process of browsing, editing,of browsing, editing, compiling, running and/orcompiling, running and/or testingtesting The set of source codeThe set of source code files that Windowsfiles that Windows Explorer displaysExplorer displays
  • 16. Interacting with otherInteracting with other reposrepos
  • 17. Most git commandsMost git commands affect only youaffect only you Except for:Except for: PushPush PullPull FetchFetch CloneClone (SVN/CVS/etc.)(SVN/CVS/etc.) Obscure plumbingObscure plumbing
  • 18. git clonegit clone Creates a new repositoryCreates a new repository on your local machineon your local machine The new repo is a copy ofThe new repo is a copy of the repository you clonedthe repository you cloned fromfrom The alias “origin” isThe alias “origin” is assigned in your new localassigned in your new local repo to point to the onerepo to point to the one you cloned fromyou cloned from
  • 19. git fetchgit fetch Gets all changes from remoteGets all changes from remote reporepo Puts those changes in yourPuts those changes in your local repolocal repo Does not affect your workingDoes not affect your working tree or staging areatree or staging area Should not be any way youShould not be any way you can get a conflict herecan get a conflict here If there is a conflict, someoneIf there is a conflict, someone did something unwisedid something unwise
  • 20. git pullgit pull 'git fetch' plus 'git merge' in one "easier'git fetch' plus 'git merge' in one "easier to type" command lineto type" command line I don’t use this, I recommend you don’tI don’t use this, I recommend you don’t eithereither NEVER pull without specifying a repoNEVER pull without specifying a repo and branch, or git will "guess"and branch, or git will "guess" You wouldn't merge from "whereverYou wouldn't merge from "wherever the source control software feels like",the source control software feels like", you shouldn't pull that way eitheryou shouldn't pull that way either Don’t pull it if you don’t know youDon’t pull it if you don’t know you want to be stuck with itwant to be stuck with it prefer “fetch + merge” if you haveprefer “fetch + merge” if you have changes or “fetch + reset” if you don’tchanges or “fetch + reset” if you don’t
  • 21. git pushgit push Take all changes associated with theTake all changes associated with the specified branch and give thespecified branch and give the specified remote server any of themspecified remote server any of them it is missingit is missing If someone else doesn’t see yourIf someone else doesn’t see your changes, you forgot to do thischanges, you forgot to do this Always specify remote alias andAlways specify remote alias and branchbranch Like with the "pull" command, youLike with the "pull" command, you shouldn’t let the software "guess"shouldn’t let the software "guess" opposite of fetch (NOT the oppositeopposite of fetch (NOT the opposite of pull)of pull) never push to a repo that contains anever push to a repo that contains a working directoryworking directory
  • 22. Working in your repoWorking in your repo
  • 23. git addgit add Puts changes into thePuts changes into the “staging area”“staging area”
  • 24. git commitgit commit puts staged changes intoputs staged changes into the local repositorythe local repository I try to do this every timeI try to do this every time I compileI compile When in any doubt,When in any doubt, commit first!commit first!
  • 25. git statusgit status Shows changes in yourShows changes in your working directory andworking directory and staging areastaging area
  • 26. git loggit log Shows you the history ofShows you the history of where you arewhere you are Usually, this is the place toUsually, this is the place to use a GUI instead, thoughuse a GUI instead, though How did I get here?How did I get here?
  • 27. git checkoutgit checkout Put the files in yourPut the files in your working directory in aworking directory in a known stateknown state Almost alwaysAlmost always corresponding to acorresponding to a particular local branchparticular local branch You can use the ‘-b’ flag toYou can use the ‘-b’ flag to checkout to make a newcheckout to make a new local branch and switchlocal branch and switch your working directory toyour working directory to it at the same timeit at the same time
  • 28. git branchgit branch Make a new (local) branchMake a new (local) branch List existing (local orList existing (local or cached) branchescached) branches Delete a (local) branchDelete a (local) branch
  • 29. git reset /git reset / git cleangit clean git cleangit cleanremove changes youremove changes you (hopefully) don’t want from(hopefully) don’t want from your wayyour way puts the working directoryputs the working directory and/or the staging area back inand/or the staging area back in a known statea known state I use this a lot to sync up to aI use this a lot to sync up to a branch I don’t have changes inbranch I don’t have changes in This can lose data - BEThis can lose data - BE CAREFUL!!CAREFUL!! When in any doubt, commitWhen in any doubt, commit first!first!
  • 30. git mergegit merge merge 2 or more branchesmerge 2 or more branches uses 3-way mergesuses 3-way merges works REALLY wellworks REALLY well any merge info will get lost ifany merge info will get lost if you push the result to SVNyou push the result to SVN No tool substitutes for aNo tool substitutes for a lack of coordination!lack of coordination! git mergetool helps with thisgit mergetool helps with this
  • 31. git rebasegit rebase rearrange commitsrearrange commits (illustration coming up(illustration coming up later)later) do NOT do this ifdo NOT do this if someone else is sharingsomeone else is sharing your changesyour changes do NOT share changes ifdo NOT share changes if you’re going to do thisyou’re going to do this
  • 32. git helpgit help fairly thorough, but oftenfairly thorough, but often dense documentationdense documentation Other resources:Other resources: http://git.or.cz/course/svn.htmlhttp://git.or.cz/course/svn.html http://utsl.gen.nz/talks/gihttp://utsl.gen.nz/talks/gi t-svn/intro.htmlt-svn/intro.html
  • 33. Some things you probablySome things you probably shouldn’t doshouldn’t do ‘‘git revert’ probablygit revert’ probably doesn’t do what you thinkdoesn’t do what you think if you do have to use it,if you do have to use it, clean up after yourselfclean up after yourself as soon as you canas soon as you can git push -fgit push -f if you think you need toif you think you need to do this - something baddo this - something bad hopefully happened.hopefully happened. Should not be routine.Should not be routine.
  • 35. Pro Tips and BestPro Tips and Best PracticesPractices commit as often as you build/compilecommit as often as you build/compile a good commit diff, like a good method, should fit on your screena good commit diff, like a good method, should fit on your screen don’t worry if it’s not good enough (no one can see it until you push)don’t worry if it’s not good enough (no one can see it until you push) you might want to get back here (the next thing you do might break)you might want to get back here (the next thing you do might break) you can always squash lateryou can always squash later push when you would have committed in cvs/svnpush when you would have committed in cvs/svn only push when you won’t “break the build” or when tests passonly push when you won’t “break the build” or when tests pass don’t forget to push when you want other people to see your workdon’t forget to push when you want other people to see your work branch for every complete functional set/bug fix/featurebranch for every complete functional set/bug fix/feature keeping functionality separate makes life easier laterkeeping functionality separate makes life easier later feel free to branch retroactively (but not what svn means by that)feel free to branch retroactively (but not what svn means by that)
  • 36. Simplified Dev WorkflowSimplified Dev Workflow (For Larger Teams)(For Larger Teams) (For Larger Teams)(For Larger Teams) Get latestGet latest git fetch origingit fetch origin Create a new branch for each bug or featureCreate a new branch for each bug or feature git checkout -b ${feature} origin/${oldbranch}git checkout -b ${feature} origin/${oldbranch} Make your changes as beforeMake your changes as before (hopefully committing more often)(hopefully committing more often) Check inYour Changes LocallyCheck inYour Changes Locally git commit -am “An Intelligent Comment”git commit -am “An Intelligent Comment” Push changes back where others can find themPush changes back where others can find them git push origin ${feature}git push origin ${feature} Later, merge feature branches together to make Release CandidatesLater, merge feature branches together to make Release Candidates
  • 37. Making ReleaseMaking Release Candidate BranchesCandidate Branches
  • 38. Three Different CombiningThree Different Combining OptionsOptions MergeMerge Keeps HistoryKeeps History Should Use --no-ffShould Use --no-ff Harder to trace later in logsHarder to trace later in logs RebaseRebase Simplifies History in LogsSimplifies History in Logs Better for things withoutBetter for things without common recent parentcommon recent parent Loses some history infoLoses some history info Cherry-PickCherry-Pick Just like rebase but for singleJust like rebase but for single commitscommits
  • 39. MergingMerging ““git checkout ${destinationgit checkout ${destination branch}”branch}” ““git merge ${feature branch}”git merge ${feature branch}” ““git mergetool” if conflictsgit mergetool” if conflicts ““git checkout --ours” orgit checkout --ours” or “git checkout --theirs” if“git checkout --theirs” if you want to pick oneyou want to pick one ““git merge ${second featuregit merge ${second feature branch}”branch}”
  • 40. RebaseRebase ““git checkout ${feature branch}”git checkout ${feature branch}” ““git checkout -b ${new name}”git checkout -b ${new name}” to copyto copy ““git rebase ${destinationgit rebase ${destination branch}”branch}” if you want every commitif you want every commit back to common point, orback to common point, or ““git rebase --ontogit rebase --onto ${destination branch}${destination branch} ${last commit not to take}${last commit not to take} ${feature branch}”${feature branch}” If you want a subsetIf you want a subset
  • 41. Rebasing ExampleRebasing Example initial stateinitial state Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9serverserverserverserver clientclientclientclient
  • 42. Rebasing ExampleRebasing Example git checkout servergit checkout server git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9serverserverserverserver clientclientclientclient C3C3C3C3 C4C4C4C4 C7C7C7C7
  • 43. Rebasing ExampleRebasing Example git checkout servergit checkout server git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9 serverserverserverserver clientclientclientclient C3C3C3C3 C4C4C4C4 C7C7C7C7
  • 44. Rebasing ExampleRebasing Example git checkout servergit checkout server git rebase mastergit rebase master Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9 serverserverserverserver clientclientclientclient C3’C3’C3’C3’ C4’C4’C4’C4’ C7’C7’C7’C7’
  • 45. Rebasing ExampleRebasing Example initial stateinitial state Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9serverserverserverserver clientclientclientclient
  • 46. Rebasing ExampleRebasing Example git rebase --onto master server clientgit rebase --onto master server client Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9serverserverserverserver clientclientclientclient
  • 47. Rebasing ExampleRebasing Example git rebase --onto master server clientgit rebase --onto master server client Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8C8C8C8 C9C9C9C9 serverserverserverserver clientclientclientclient
  • 48. Rebasing ExampleRebasing Example git rebase --onto master server clientgit rebase --onto master server client Figures adapted fromFigures adapted from Pro GitPro Git by Scott Chaconby Scott Chacon C1C1C1C1 mastemaste rr mastemaste rr C2C2C2C2 C5C5C5C5 C6C6C6C6 C3C3C3C3 C4C4C4C4 C7C7C7C7 C8’C8’C8’C8’ C9’C9’C9’C9’ serverserverserverserver clientclientclientclient
  • 49. Staying current with SVNStaying current with SVN git svn fetchgit svn fetch Doesn’t update workingDoesn’t update working tree, but gets branchestree, but gets branches git svn rebasegit svn rebase puts SVN revision IDs inputs SVN revision IDs in git commentsgit comments have to do this to stay inhave to do this to stay in syncsync Loses git history, so makeLoses git history, so make copied branches in git firstcopied branches in git first
  • 50. Pushing back to SVNPushing back to SVN git svn dcommitgit svn dcommit simplest and safest on SVN sidesimplest and safest on SVN side requires you rebase in latest SVNrequires you rebase in latest SVN changeschanges Make a copied branch in git to doMake a copied branch in git to do this onthis on May be preceded by “git resetMay be preceded by “git reset --hard $git_branch”--hard $git_branch” git svn set-treegit svn set-tree Overwrites SVN ignorantly (withOverwrites SVN ignorantly (with extreme prejudice)extreme prejudice) nuking the site from Orbitnuking the site from Orbit