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
Introduction to Git (part 1)
SourceTree configuration (1)
• Fullname
• Email address
• Project folder
Introduction to Git (part 1)
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
Introduction to Git (part 1)
• 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.
Introduction to Git (part 1)
• 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/
Introduction to Git (part 1)
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
Ad

More Related Content

What's hot (20)

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
 
Learning git
Learning gitLearning git
Learning git
Sid Anand
 
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
 
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
 
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
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
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
 

Viewers also liked (9)

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
 
eBay Selling Secrets Revealed
eBay Selling Secrets RevealedeBay Selling Secrets Revealed
eBay Selling Secrets Revealed
denlu244
 
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
 
Ad

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

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
Introduction to Git and GitHub
Bioinformatics and Computational Biosciences Branch
 
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
Gitlikeapro 2019
Jesús Miguel Benito Calzada
 
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
 
Git slides
Git slidesGit slides
Git slides
Nanyak S
 
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 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
 
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 tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
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
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
Muhil Vannan
 
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
 
Ad

More from Salvatore Cordiano (20)

The McKinsey Approach to Problem Solving
The McKinsey Approach to Problem SolvingThe McKinsey Approach to Problem Solving
The McKinsey Approach to Problem Solving
Salvatore Cordiano
 
Human bugs - Why is thinking hard - Tech Talk
Human bugs - Why is thinking hard - Tech TalkHuman bugs - Why is thinking hard - Tech Talk
Human bugs - Why is thinking hard - Tech Talk
Salvatore Cordiano
 
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
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
 
The McKinsey Approach to Problem Solving
The McKinsey Approach to Problem SolvingThe McKinsey Approach to Problem Solving
The McKinsey Approach to Problem Solving
Salvatore Cordiano
 
Human bugs - Why is thinking hard - Tech Talk
Human bugs - Why is thinking hard - Tech TalkHuman bugs - Why is thinking hard - Tech Talk
Human bugs - Why is thinking hard - Tech Talk
Salvatore Cordiano
 
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
Attestato Masterclass Kaospilot - The Art & Craft of Designing & Facilitating...
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
 
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
 
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
 

Recently uploaded (20)

Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest VersionAdobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
usmanhidray
 
Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest VersionAdobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
usmanhidray
 

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
  • 6. SourceTree configuration (1) • Fullname • Email address • Project folder
  • 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
  • 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.
  • 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/
  • 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