SlideShare a Scribd company logo
Introduction to
Git
@parallelit
(part 1)
Agenda
• Git References
• SourceTree configuration
• Git history
• working directory, Git
directory, staging area
• File Status Lifecycle
• git init, clone, checkout, add,
commit, blame, log, status,
pull, fetch, push, archive
• gitignore
• Git in action
• HEAD or head?
• Fast-forward Merge
• Tracked branches
• Tagging
• git commit --amend
Git References
• https://www.atlassian.com/git/
• https://git-scm.com/documentation
• http://www.vogella.com/tutorials/Git/article.html
Git history
• Git repository is one giant graph
• Node := a Git commit is a node in a graph
SourceTree configuration (1)
• Fullname
• Email address
• Project folder
SourceTree configuration (2)
• Visual Diff Tool
• Merge Tool
What is a branch?
A branch represents an independent line of
development.
• git init := Create an empty Git repository or
reinitialize an existing one
• git clone := Clone a repository into a new
directory from remote Git server
• git checkout := Switch branches or restore
working tree files
• git add := Add file contents to the index (staging
area)
• git commit := Record changes to the repository
Directory
Git doesn’t track directories, it tracks files, so to
acheive this you need to track at least one file
• working directory := A folder that contains an
initialized GIT repository
• Git directory := It’s contained in working directory
and it’s called “.git”. In the Git directory there are
files and folders that compose our repository
• staging area := The staging area is a file, generally
contained in your Git directory, that stores
information about what will go into your next
commit. It’s sometimes referred to as the “index”,
but it’s also common to refer to it as the staging
area.
• git blame := Show what revision and author last
modified each line of a file
• git log := Show commit logs
• git status := Show the working tree status
• git pull := Fetch from and integrate with another
repository or a local branch (fetch + merge)
• git fetch := Download objects and refs from
another repository
• git push := Update remote refs along with
associated objects
• git archive := Create an archive of files from a
named tree
.gitignore (1)
• A gitignore file specifies intentionally untracked
files that Git should ignore.
• Files already tracked by Git are not affected.
• Each line in a gitignore file specifies a pattern.
• Three levels: $GIT_DIR, $HOME,
$WORKING_DIR
.gitignore (2)
composer.phar
*.log
wp-content/uploads/
config/autoload/*.local.php
/bin/*
.gitignore (3)
• http://git-scm.com/docs/gitignore
• https://github.com/github/gitignore
• https://www.gitignore.io/
Git in action
HEAD o head?
• A head is simply a reference to a commit object. Each
head has a name (branch name or tag name, etc). By
default, there is a head in every repository called
master. A repository can contain any number of heads.
At any given time, one head is selected as the “current
head”. This head is aliased to HEAD, always in
capitals.
• Note this difference: a “head” (lowercase) refers to any
one of the named heads in the repository;
“HEAD” (uppercase) refers exclusively to the currently
active head. This distinction is used frequently in Git
documentation.
Fast-forward Git merge (1)
Merging a branch is a pretty common operation
when using Git.
In some circumstances, Git by default will try to
merge a branch in a fast-forward mode.
Fast-forward Git merge (2)
Let us assume that I created
a feature branch named test
from the current master. After
working on this branch for a
while, I finally decided that I
am done and then I pushed it
to my own remote.
Meanwhile, nothing else
happened in the master
branch, it remained in the
same state right before I
branched off.
master
feature/test
3 commit
Fast-forward Git merge (3)
Once my branch is ready to be
integrated, we might use the
usual steps of git fetch followed
by git merge (git pull). Because
master has not been changed
since the commit (gray circle)
which serves as the base for
the said topic branch, Git will
perform the merge using fast-
forward. The whole series of the
commits will be linear. The
history will look like the
diagram on the right.
Fast-forward Git merge (4)
Another variant of the merge is
to use -no-ff option (no fast-
forward). In this case, the
history looks slightly different,
there is an additional commit
(dotted circle) emphasizing the
merge. This commit even has
the right message informing
us about the merged branch.
The default behaviour of Git is
to use fast-forwarding
whenever possible.
merge
Introducing Tracked branches
(Local and remote branches)
• A local branch is a branch that only you (the local user) can
see. It exists only on your local machine.
• If you're using Git collaboratively, you'll probably need to sync
your commits with other machines or locations. Each machine
or location is called a remote, in Git's terminology, and each
one may have one or more branches. Most often, you'll just
have one, named origin.
• A remote branch was once a local branch that was pushed to
origin. In other words now every user has access to it.
• A local tracking branch on the other hand is a branch that is a
local image of the remote branch (think of it as your copy of the
remote branch).
Tracked branches (1)
(Remote tracking branch)
• Each branch has the concept of what it is
tracking. As well as the branches that will be
affected by a fetch/pull/push, tracking says
which branch is upstream of which.
• Normally, branches checked out of a remote
repository are automatically set up as tracking
branches.
Tracked branches (2)
(Remote tracking branch)
• They’re used to link what you’re working on
locally compared to what’s on the remote.
• They will automatically know what remote
branch to get changes from when you use git
pull/fetch/push.
• Even better, git status will recognize him how
many commits you are in front of the remote
version of the branch.
Tagging (1)
• Git has the ability to tag specific points in history as
being important. Typically people use this functionality to
mark release points.
• Git uses two main types of tags: lightweight and
annotated.
• A lightweight tag is very much like a branch that doesn’t
(shouldn’t) change. It’s just a pointer to a specific commit.
• Annotated tags, however, are stored as full objects in the
Git database. They contain the tagger name, email, and
date and they have a tagging message.
Tagging (2)
• By default, the git push command doesn’t
transfer tags to remote servers.
• By default, SourceTree transfers tags to remote
servers (Look at push all tags checkbox on
push window).
git commit --amend (1)
The git commit --amend command is a convenient
way to fix up the most recent commit.
It lets you combine staged changes with the
previous commit instead of committing it as an
entirely new snapshot.
It can also be used to simply edit the previous
commit message without changing its snapshot.
git commit --amend (2)
But, amending
doesn’t just alter the
most recent commit. It
replaces it entirely. To
Git, it will look like a
brand new commit,
which is visualized
with an asterisk (*) in
the diagram.
*
Initial history
Amended history
git commit --amend (3)
Never amend commits that have been pushed to a
public repository.
Coming next
• Reset (soft, mixed, hard)
• Rebase
• Checkout
• Revert
• Branching
• Merging
• Gitflow Workflow
• GitHub Flow
http://sal.va.it/1LNuBGx
Download these slides on

More Related Content

What's hot

git and github
git and githubgit and github
git and github
Darren Oakley
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Elli Kanal
 
Git 101
Git 101Git 101
Git 101
Sachet Mittal
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
Anurag Upadhaya
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Bitbucket
BitbucketBitbucket
Bitbucket
hariprasad1035
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
Carl Brown
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Somkiat Puisungnoen
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Intro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostIntro to Git, GitHub, and Devpost
Intro to Git, GitHub, and Devpost
Andrew Kerr
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
James Aylett
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
Arnaud Seilles
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
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
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
SV Ruby on Rails Meetup
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 

What's hot (20)

git and github
git and githubgit and github
git and github
 
Learning git
Learning gitLearning git
Learning git
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git 101
Git 101Git 101
Git 101
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Intro to Git, GitHub, and Devpost
Intro to Git, GitHub, and DevpostIntro to Git, GitHub, and Devpost
Intro to Git, GitHub, and Devpost
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
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
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git basics
Git basicsGit basics
Git basics
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 

Viewers also liked

eBay Selling Secrets Revealed
eBay Selling Secrets RevealedeBay Selling Secrets Revealed
eBay Selling Secrets Revealed
denlu244
 
Gitlab
GitlabGitlab
Gitlab
Tom Chen
 
5-Hour Gamification Workshop for eBay
5-Hour Gamification Workshop for eBay5-Hour Gamification Workshop for eBay
5-Hour Gamification Workshop for eBay
Yu-kai Chou
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
Teerapat Khunpech
 
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
Geoff Hoffman
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
Rohit Arora
 
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADEROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
sushmitha7
 
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
 
The 150 Most Powerful Marketing & Sales Tools
The 150 Most Powerful Marketing & Sales ToolsThe 150 Most Powerful Marketing & Sales Tools
The 150 Most Powerful Marketing & Sales Tools
Brian Downard
 

Viewers also liked (9)

eBay Selling Secrets Revealed
eBay Selling Secrets RevealedeBay Selling Secrets Revealed
eBay Selling Secrets Revealed
 
Gitlab
GitlabGitlab
Gitlab
 
5-Hour Gamification Workshop for eBay
5-Hour Gamification Workshop for eBay5-Hour Gamification Workshop for eBay
5-Hour Gamification Workshop for eBay
 
Gitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTreeGitlab Training with GIT and SourceTree
Gitlab Training with GIT and SourceTree
 
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
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
 
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADEROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
ROLE OF EXPORT MARKETING IN INTERNATIONAL TRADE
 
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
 
The 150 Most Powerful Marketing & Sales Tools
The 150 Most Powerful Marketing & Sales ToolsThe 150 Most Powerful Marketing & Sales Tools
The 150 Most Powerful Marketing & Sales Tools
 

Similar to Introduction to Git (part 1)

Git slides
Git slidesGit slides
Git slides
Nanyak S
 
Introduction to Git (part 2)
Introduction to Git (part 2)Introduction to Git (part 2)
Introduction to Git (part 2)
Salvatore Cordiano
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016
Peter Denev
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Mastering GIT
Mastering GITMastering GIT
Mastering GIT
Hasnaeen Rahman
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Ahmed El-Arabawy
 
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Nicola Costantino
 
Git 101
Git 101Git 101
Git 101
jayrparro
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
Gitlikeapro 2019
Gitlikeapro 2019Gitlikeapro 2019
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
 
Intro to Git
Intro to GitIntro to Git
Intro to Git
Shadab Khan
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
Muhil Vannan
 
Git more done
Git more doneGit more done
Git more done
Kwen Peterson
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
Prakash Dantuluri
 

Similar to Introduction to Git (part 1) (20)

Git slides
Git slidesGit slides
Git slides
 
Introduction to Git (part 2)
Introduction to Git (part 2)Introduction to Git (part 2)
Introduction to Git (part 2)
 
11 git version control
11 git version control11 git version control
11 git version control
 
GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016GIT_training_SoftServeBulgaria2016
GIT_training_SoftServeBulgaria2016
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Mastering GIT
Mastering GITMastering GIT
Mastering GIT
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
 
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
 
Git 101
Git 101Git 101
Git 101
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Gitlikeapro 2019
Gitlikeapro 2019Gitlikeapro 2019
Gitlikeapro 2019
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Intro to Git
Intro to GitIntro to Git
Intro to Git
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
 
Git more done
Git more doneGit more done
Git more done
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 

More from Salvatore Cordiano

Transformed: Moving to the Product Operating Model
Transformed: Moving to the Product Operating ModelTransformed: Moving to the Product Operating Model
Transformed: Moving to the Product Operating Model
Salvatore Cordiano
 
Executive Master in Business Administration
Executive Master in Business AdministrationExecutive Master in Business Administration
Executive Master in Business Administration
Salvatore Cordiano
 
Facile.it Partner 🚀 Hackathon 2023 - What we learned
Facile.it Partner 🚀 Hackathon 2023 - What we learnedFacile.it Partner 🚀 Hackathon 2023 - What we learned
Facile.it Partner 🚀 Hackathon 2023 - What we learned
Salvatore Cordiano
 
Accrescere la motivazione per raggiungere gli obiettivi
Accrescere la motivazione per raggiungere gli obiettiviAccrescere la motivazione per raggiungere gli obiettivi
Accrescere la motivazione per raggiungere gli obiettivi
Salvatore Cordiano
 
Il potere delle domande
Il potere delle domandeIl potere delle domande
Il potere delle domande
Salvatore Cordiano
 
Impara a delegare
Impara a delegareImpara a delegare
Impara a delegare
Salvatore Cordiano
 
Migliora il tuo ascolto
Migliora il tuo ascoltoMigliora il tuo ascolto
Migliora il tuo ascolto
Salvatore Cordiano
 
Negoziazione organizzativa
Negoziazione organizzativaNegoziazione organizzativa
Negoziazione organizzativa
Salvatore Cordiano
 
Migliora le prestazioni dei tuoi collaboratori
Migliora le prestazioni dei tuoi collaboratoriMigliora le prestazioni dei tuoi collaboratori
Migliora le prestazioni dei tuoi collaboratori
Salvatore Cordiano
 
Charles Péguy - Il denaro
Charles Péguy - Il denaroCharles Péguy - Il denaro
Charles Péguy - Il denaro
Salvatore Cordiano
 
Delivering Effective Feedback - FP Talks
Delivering Effective Feedback - FP TalksDelivering Effective Feedback - FP Talks
Delivering Effective Feedback - FP Talks
Salvatore Cordiano
 
No Silver Bullet - Essence and Accident in Software Engineering
No Silver Bullet - Essence and Accident in Software EngineeringNo Silver Bullet - Essence and Accident in Software Engineering
No Silver Bullet - Essence and Accident in Software Engineering
Salvatore Cordiano
 
Facile.it Partner Hackathon - What we learned
Facile.it Partner Hackathon - What we learnedFacile.it Partner Hackathon - What we learned
Facile.it Partner Hackathon - What we learned
Salvatore Cordiano
 
FP Hackathon - Closing, remarks and awards ceremony
FP Hackathon - Closing, remarks and awards ceremonyFP Hackathon - Closing, remarks and awards ceremony
FP Hackathon - Closing, remarks and awards ceremony
Salvatore Cordiano
 
Facile.it Partner Hackathon 2022
Facile.it Partner Hackathon 2022Facile.it Partner Hackathon 2022
Facile.it Partner Hackathon 2022
Salvatore Cordiano
 
Remarks about Ownership
Remarks about OwnershipRemarks about Ownership
Remarks about Ownership
Salvatore Cordiano
 
Introducing Kaizen
Introducing KaizenIntroducing Kaizen
Introducing Kaizen
Salvatore Cordiano
 
Introducing Eisenhower Matrix
Introducing Eisenhower MatrixIntroducing Eisenhower Matrix
Introducing Eisenhower Matrix
Salvatore Cordiano
 
The Blake Mouton Managerial Grid
The Blake Mouton Managerial GridThe Blake Mouton Managerial Grid
The Blake Mouton Managerial Grid
Salvatore Cordiano
 
Facile.it Partner Hackathon (kick-off)
Facile.it Partner Hackathon (kick-off)Facile.it Partner Hackathon (kick-off)
Facile.it Partner Hackathon (kick-off)
Salvatore Cordiano
 

More from Salvatore Cordiano (20)

Transformed: Moving to the Product Operating Model
Transformed: Moving to the Product Operating ModelTransformed: Moving to the Product Operating Model
Transformed: Moving to the Product Operating Model
 
Executive Master in Business Administration
Executive Master in Business AdministrationExecutive Master in Business Administration
Executive Master in Business Administration
 
Facile.it Partner 🚀 Hackathon 2023 - What we learned
Facile.it Partner 🚀 Hackathon 2023 - What we learnedFacile.it Partner 🚀 Hackathon 2023 - What we learned
Facile.it Partner 🚀 Hackathon 2023 - What we learned
 
Accrescere la motivazione per raggiungere gli obiettivi
Accrescere la motivazione per raggiungere gli obiettiviAccrescere la motivazione per raggiungere gli obiettivi
Accrescere la motivazione per raggiungere gli obiettivi
 
Il potere delle domande
Il potere delle domandeIl potere delle domande
Il potere delle domande
 
Impara a delegare
Impara a delegareImpara a delegare
Impara a delegare
 
Migliora il tuo ascolto
Migliora il tuo ascoltoMigliora il tuo ascolto
Migliora il tuo ascolto
 
Negoziazione organizzativa
Negoziazione organizzativaNegoziazione organizzativa
Negoziazione organizzativa
 
Migliora le prestazioni dei tuoi collaboratori
Migliora le prestazioni dei tuoi collaboratoriMigliora le prestazioni dei tuoi collaboratori
Migliora le prestazioni dei tuoi collaboratori
 
Charles Péguy - Il denaro
Charles Péguy - Il denaroCharles Péguy - Il denaro
Charles Péguy - Il denaro
 
Delivering Effective Feedback - FP Talks
Delivering Effective Feedback - FP TalksDelivering Effective Feedback - FP Talks
Delivering Effective Feedback - FP Talks
 
No Silver Bullet - Essence and Accident in Software Engineering
No Silver Bullet - Essence and Accident in Software EngineeringNo Silver Bullet - Essence and Accident in Software Engineering
No Silver Bullet - Essence and Accident in Software Engineering
 
Facile.it Partner Hackathon - What we learned
Facile.it Partner Hackathon - What we learnedFacile.it Partner Hackathon - What we learned
Facile.it Partner Hackathon - What we learned
 
FP Hackathon - Closing, remarks and awards ceremony
FP Hackathon - Closing, remarks and awards ceremonyFP Hackathon - Closing, remarks and awards ceremony
FP Hackathon - Closing, remarks and awards ceremony
 
Facile.it Partner Hackathon 2022
Facile.it Partner Hackathon 2022Facile.it Partner Hackathon 2022
Facile.it Partner Hackathon 2022
 
Remarks about Ownership
Remarks about OwnershipRemarks about Ownership
Remarks about Ownership
 
Introducing Kaizen
Introducing KaizenIntroducing Kaizen
Introducing Kaizen
 
Introducing Eisenhower Matrix
Introducing Eisenhower MatrixIntroducing Eisenhower Matrix
Introducing Eisenhower Matrix
 
The Blake Mouton Managerial Grid
The Blake Mouton Managerial GridThe Blake Mouton Managerial Grid
The Blake Mouton Managerial Grid
 
Facile.it Partner Hackathon (kick-off)
Facile.it Partner Hackathon (kick-off)Facile.it Partner Hackathon (kick-off)
Facile.it Partner Hackathon (kick-off)
 

Recently uploaded

美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
widenerjobeyrl638
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 

Recently uploaded (20)

美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 

Introduction to Git (part 1)

  • 2. Agenda • Git References • SourceTree configuration • Git history • working directory, Git directory, staging area • File Status Lifecycle • git init, clone, checkout, add, commit, blame, log, status, pull, fetch, push, archive • gitignore • Git in action • HEAD or head? • Fast-forward Merge • Tracked branches • Tagging • git commit --amend
  • 3. Git References • https://www.atlassian.com/git/ • https://git-scm.com/documentation • http://www.vogella.com/tutorials/Git/article.html
  • 4. Git history • Git repository is one giant graph • Node := a Git commit is a node in a graph
  • 5.
  • 6. SourceTree configuration (1) • Fullname • Email address • Project folder
  • 7.
  • 8. SourceTree configuration (2) • Visual Diff Tool • Merge Tool
  • 9. What is a branch? A branch represents an independent line of development.
  • 10. • git init := Create an empty Git repository or reinitialize an existing one • git clone := Clone a repository into a new directory from remote Git server • git checkout := Switch branches or restore working tree files
  • 11. • git add := Add file contents to the index (staging area) • git commit := Record changes to the repository
  • 12. Directory Git doesn’t track directories, it tracks files, so to acheive this you need to track at least one file
  • 13.
  • 14. • working directory := A folder that contains an initialized GIT repository • Git directory := It’s contained in working directory and it’s called “.git”. In the Git directory there are files and folders that compose our repository • staging area := The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit. It’s sometimes referred to as the “index”, but it’s also common to refer to it as the staging area.
  • 15.
  • 16. • git blame := Show what revision and author last modified each line of a file • git log := Show commit logs • git status := Show the working tree status
  • 17. • git pull := Fetch from and integrate with another repository or a local branch (fetch + merge) • git fetch := Download objects and refs from another repository • git push := Update remote refs along with associated objects
  • 18. • git archive := Create an archive of files from a named tree
  • 19. .gitignore (1) • A gitignore file specifies intentionally untracked files that Git should ignore. • Files already tracked by Git are not affected. • Each line in a gitignore file specifies a pattern. • Three levels: $GIT_DIR, $HOME, $WORKING_DIR
  • 21. .gitignore (3) • http://git-scm.com/docs/gitignore • https://github.com/github/gitignore • https://www.gitignore.io/
  • 22.
  • 24. HEAD o head? • A head is simply a reference to a commit object. Each head has a name (branch name or tag name, etc). By default, there is a head in every repository called master. A repository can contain any number of heads. At any given time, one head is selected as the “current head”. This head is aliased to HEAD, always in capitals. • Note this difference: a “head” (lowercase) refers to any one of the named heads in the repository; “HEAD” (uppercase) refers exclusively to the currently active head. This distinction is used frequently in Git documentation.
  • 25. Fast-forward Git merge (1) Merging a branch is a pretty common operation when using Git. In some circumstances, Git by default will try to merge a branch in a fast-forward mode.
  • 26. Fast-forward Git merge (2) Let us assume that I created a feature branch named test from the current master. After working on this branch for a while, I finally decided that I am done and then I pushed it to my own remote. Meanwhile, nothing else happened in the master branch, it remained in the same state right before I branched off. master feature/test 3 commit
  • 27. Fast-forward Git merge (3) Once my branch is ready to be integrated, we might use the usual steps of git fetch followed by git merge (git pull). Because master has not been changed since the commit (gray circle) which serves as the base for the said topic branch, Git will perform the merge using fast- forward. The whole series of the commits will be linear. The history will look like the diagram on the right.
  • 28. Fast-forward Git merge (4) Another variant of the merge is to use -no-ff option (no fast- forward). In this case, the history looks slightly different, there is an additional commit (dotted circle) emphasizing the merge. This commit even has the right message informing us about the merged branch. The default behaviour of Git is to use fast-forwarding whenever possible. merge
  • 29. Introducing Tracked branches (Local and remote branches) • A local branch is a branch that only you (the local user) can see. It exists only on your local machine. • If you're using Git collaboratively, you'll probably need to sync your commits with other machines or locations. Each machine or location is called a remote, in Git's terminology, and each one may have one or more branches. Most often, you'll just have one, named origin. • A remote branch was once a local branch that was pushed to origin. In other words now every user has access to it. • A local tracking branch on the other hand is a branch that is a local image of the remote branch (think of it as your copy of the remote branch).
  • 30. Tracked branches (1) (Remote tracking branch) • Each branch has the concept of what it is tracking. As well as the branches that will be affected by a fetch/pull/push, tracking says which branch is upstream of which. • Normally, branches checked out of a remote repository are automatically set up as tracking branches.
  • 31. Tracked branches (2) (Remote tracking branch) • They’re used to link what you’re working on locally compared to what’s on the remote. • They will automatically know what remote branch to get changes from when you use git pull/fetch/push. • Even better, git status will recognize him how many commits you are in front of the remote version of the branch.
  • 32. Tagging (1) • Git has the ability to tag specific points in history as being important. Typically people use this functionality to mark release points. • Git uses two main types of tags: lightweight and annotated. • A lightweight tag is very much like a branch that doesn’t (shouldn’t) change. It’s just a pointer to a specific commit. • Annotated tags, however, are stored as full objects in the Git database. They contain the tagger name, email, and date and they have a tagging message.
  • 33. Tagging (2) • By default, the git push command doesn’t transfer tags to remote servers. • By default, SourceTree transfers tags to remote servers (Look at push all tags checkbox on push window).
  • 34. git commit --amend (1) The git commit --amend command is a convenient way to fix up the most recent commit. It lets you combine staged changes with the previous commit instead of committing it as an entirely new snapshot. It can also be used to simply edit the previous commit message without changing its snapshot.
  • 35. git commit --amend (2) But, amending doesn’t just alter the most recent commit. It replaces it entirely. To Git, it will look like a brand new commit, which is visualized with an asterisk (*) in the diagram. * Initial history Amended history
  • 36. git commit --amend (3) Never amend commits that have been pushed to a public repository.
  • 37. Coming next • Reset (soft, mixed, hard) • Rebase • Checkout • Revert • Branching • Merging • Gitflow Workflow • GitHub Flow