SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
git
MOST OF THE THINGS ABOUT A TRENDING DVCS
ISURU WIMALASUNDERA
VERSION CONTROL
▸ version control , revision control & source control are
referring to the same…
▸ version control systems are to manage the changes done
on software programs, documents and any collection of
information .
▸ Centralized version control systems (CVCS) and
Distributed version (DVCS)
▸ CVCS - CVS , Subversion (SVN) , Perforce
DVCS …
▸ Mercurial, Git and Bazaar
▸ Has a central repository But ….
▸ Do not rely on that central repo to
store all the versions of a project.
▸ every developer “clones” a copy of
the central repository.
▸ The “clone” copy has the full history
and all meta-data of the original.
▸ “pull” to get new change, “push” to
add new change.
ADVANTAGES & DISADVANTAGES OF DVCS
▸ pushing and pulling changes are fast , as it is not accessing
a remote server but your own hard drive.
▸ offline commit of changes.
▸ can commit a set of changes without affecting others.
▸ Others can refer ones local repository and check changes.
▸ If the main repo is very large and has long history it can
consume large amount of space and lot of time to
download.
"I'M AN EGOTISTICAL BASTARD, AND I NAME ALL MY
PROJECTS AFTER MYSELF. FIRST 'LINUX', NOW 'GIT'."
Linus Torvalds
GIT - HOW IT ALL BEGINS
▸ founded by Linus Torvalds and the
Linux Kernel team
▸ From 1991 to 2002 modifications to
linux kernel was kept in file system as
patches.
▸ Linux moved to BitKeeper a
proprietary DVCS in 2002.
▸ BitKeeper revoked the free usage for
linux team, and Linux Kernel team
started writing their own DVCS.
▸ so came the git , and the rest is
history….
GIT COMMANDS
▸
INSTALLING GIT …
▸ Installing git - enough references are there in Google
▸ Installation methods are platform specific.
UNDERSTANDING GIT CORE
▸ git is a content-addressable filesystem, bit like Unix.
▸ means that at the core of Git is a simple key-value data
store.
▸ The key is a 40-character checksum hash.
▸ value can be different types of git objects.
▸ git Object types
▸ Tree Objects, Blob Objects, Commit Objects & Tag
Objects
UNDERSTANDING GIT CORE (CONTD.)
▸ Tree Objects represent the
repository. (similar to a folder/
directory in a file system)
▸ Blob objects are the leafs , any file
in the repository. (similar to files in
a file system)
▸ Commit Objects the functional
object of repository current status.
▸ Tag Objects categorise a commit
object by naming it.
▸ A good reference
▸ https://git-scm.com/book/en/
v2/Git-Internals-Git-Objects
CREATE YOUR GIT REPOSITORY
▸ Configure your git
▸ git config --global user.name "Your Name"
▸ git config --global user.email you@example.com
▸ Go in to your project and initialise a git repository.
▸ git init
▸ Add all the project directories and files to repository.
▸ git add .
▸ Now Commit all the added directories and files to git.
▸ git commit -m “<commit-message>”
WHERE IS THE GIT REPOSITORY ?
▸ Its there along with the project files, look for a hidden file
“.git” , a single folder , in the project root.
▸ The git repository contains
▸ Head file
▸ Objects
▸ branches
▸ logs and many more
WHAT HAPPENS WHEN YOU ADD TO GIT ?
▸ Git Three Tree
USEFUL GIT COMMANDS AT THIS STAGE
▸ git log - shows a log of all commits starting from HEAD
back to the initial commit.
▸ git status - shows which files have changed between
the current project state and HEAD.
▸ git diff - shows the diff between HEAD and the current
project state.
▸ git mv and git rm - mark files to be moved (rename)
and removed, respectively, much like git add.
HOW DOES GIT COMMIT WORKS ?
▸ git commit is the current status of repository.
▸ Represented by the Commit Object, the commit object
contains follows.
▸ The set of files currently available (changed/unchanged).
▸ Reference to parent commit (the SHA1 key of parent
commit).
▸ The SHA1 name.
▸ git add will add files to the commit object, current versions
of changed files, previous version of unchanged / un-
added files.
HOW DOES GIT COMMIT WORKS ? (CONTD.)
▸ git commit will submit the commit object, a commit is a
snapshot of the repository.
▸ Now the “new commit object” is the current status of the
git repository.
GIT BRANCHING
▸ Manage drastic changes, new features.
▸ Manage a different copy of the “master” within same
repository. which means another commit object.
▸ create a branch.
▸ git branch <name>
▸ Point HEAD to the new branch.
▸ git checkout <branch_name>
▸ Better to manage “trunk” & “branch” practice.
GIT MERGING
▸ If we are merging the branch to master, set HEAD to
master. And then merge
▸ git checkout master
▸ git merge <branch_name>
▸ Then do a new git commit.
CONFLICT RESOLUTION
▸ At the point of merging , if master repository has
changed from the ancestor commit, then conflicts can
happen at the point of merging.
▸ Git will add conflict messages at exact points.
▸ Manually edit those locations and commit.
COLLABORATIVE DEVELOPMENT
▸ Get someones git repository ,
▸ git clone <repo_url>
▸ Create a remote repo reference named as “origin”.
▸ Then new heads will get created pointing to the header
of remote repo, known as “remote heads”
▸ origin/master - for the master head
▸ origin/<branch> - for the branches
COLLABORATIVE DEVELOPMENT (CONTD.)
▸ create your own branch to work on the remote repository
branch.
▸ git branch --track [new-local-branch] [remote-
branch]
▸ get updates from remote branch.
▸ git fetch origin
▸ Now update your local “master” and branches with the
updates.
▸ git pull origin <master/branch_name>
COLLABORATIVE DEVELOPMENT (CONTD.)
▸ To push your changes to remote repository “master” or
branches.
▸ git push origin <master/branch_name>
CUSTOMERS OF GIT
▸
GIT SERVICES
▸
ANY QUESTIONS ?

Weitere ähnliche Inhalte

Was ist angesagt?

Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Paradigma Digital
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Arkadiusz Borek
 
From svn to git
From svn to gitFrom svn to git
From svn to gitNehal Shah
 
Unleashing k8 s to reduce complexities of an entire middleware platform
Unleashing k8 s to reduce complexities of an entire middleware platformUnleashing k8 s to reduce complexities of an entire middleware platform
Unleashing k8 s to reduce complexities of an entire middleware platformLakmal Warusawithana
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesRoss Kukulinski
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting StartedWildan Maulana
 
Git presentation, Viktor Pyskunov
Git presentation, Viktor PyskunovGit presentation, Viktor Pyskunov
Git presentation, Viktor PyskunovViktor Pyskunov
 
Kubernetes Webinar - Using ConfigMaps & Secrets
Kubernetes Webinar - Using ConfigMaps & Secrets Kubernetes Webinar - Using ConfigMaps & Secrets
Kubernetes Webinar - Using ConfigMaps & Secrets Janakiram MSV
 
CraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitCraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitcraftworkz
 
OpenStack@Mini-Deb Conf'16 Mumbai
OpenStack@Mini-Deb Conf'16 MumbaiOpenStack@Mini-Deb Conf'16 Mumbai
OpenStack@Mini-Deb Conf'16 MumbaiAkanksha Agrawal
 
Heketi Functionality into Glusterd2
Heketi Functionality into Glusterd2Heketi Functionality into Glusterd2
Heketi Functionality into Glusterd2Gluster.org
 
Kubernetes Basics & Monitoring
Kubernetes Basics & MonitoringKubernetes Basics & Monitoring
Kubernetes Basics & MonitoringMist.io
 
Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your applicationAndrei Marukovich
 

Was ist angesagt? (20)

Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Unleashing k8 s to reduce complexities of an entire middleware platform
Unleashing k8 s to reduce complexities of an entire middleware platformUnleashing k8 s to reduce complexities of an entire middleware platform
Unleashing k8 s to reduce complexities of an entire middleware platform
 
Git
GitGit
Git
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting Started
 
Kubernetes-Meetup
Kubernetes-MeetupKubernetes-Meetup
Kubernetes-Meetup
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Git presentation, Viktor Pyskunov
Git presentation, Viktor PyskunovGit presentation, Viktor Pyskunov
Git presentation, Viktor Pyskunov
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Webinar - Using ConfigMaps & Secrets
Kubernetes Webinar - Using ConfigMaps & Secrets Kubernetes Webinar - Using ConfigMaps & Secrets
Kubernetes Webinar - Using ConfigMaps & Secrets
 
CraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to gitCraftCamp for Students - Introduction to git
CraftCamp for Students - Introduction to git
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
OpenStack@Mini-Deb Conf'16 Mumbai
OpenStack@Mini-Deb Conf'16 MumbaiOpenStack@Mini-Deb Conf'16 Mumbai
OpenStack@Mini-Deb Conf'16 Mumbai
 
Heketi Functionality into Glusterd2
Heketi Functionality into Glusterd2Heketi Functionality into Glusterd2
Heketi Functionality into Glusterd2
 
Kubernetes Basics & Monitoring
Kubernetes Basics & MonitoringKubernetes Basics & Monitoring
Kubernetes Basics & Monitoring
 
Using NuGet libraries in your application
Using NuGet libraries in your applicationUsing NuGet libraries in your application
Using NuGet libraries in your application
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 

Ähnlich wie git- Most Of The Things About a Trending DVCS

Ähnlich wie git- Most Of The Things About a Trending DVCS (20)

Git and github
Git and githubGit and github
Git and github
 
Git
GitGit
Git
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Learning git
Learning gitLearning git
Learning git
 
Git slides
Git slidesGit slides
Git slides
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
setting up a repository using GIT
setting up a repository using GITsetting up a repository using GIT
setting up a repository using GIT
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git training
Git trainingGit training
Git training
 
Git 101
Git 101Git 101
Git 101
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 

Kürzlich hochgeladen

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 

Kürzlich hochgeladen (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 

git- Most Of The Things About a Trending DVCS

  • 1. git MOST OF THE THINGS ABOUT A TRENDING DVCS ISURU WIMALASUNDERA
  • 2. VERSION CONTROL ▸ version control , revision control & source control are referring to the same… ▸ version control systems are to manage the changes done on software programs, documents and any collection of information . ▸ Centralized version control systems (CVCS) and Distributed version (DVCS) ▸ CVCS - CVS , Subversion (SVN) , Perforce
  • 3. DVCS … ▸ Mercurial, Git and Bazaar ▸ Has a central repository But …. ▸ Do not rely on that central repo to store all the versions of a project. ▸ every developer “clones” a copy of the central repository. ▸ The “clone” copy has the full history and all meta-data of the original. ▸ “pull” to get new change, “push” to add new change.
  • 4. ADVANTAGES & DISADVANTAGES OF DVCS ▸ pushing and pulling changes are fast , as it is not accessing a remote server but your own hard drive. ▸ offline commit of changes. ▸ can commit a set of changes without affecting others. ▸ Others can refer ones local repository and check changes. ▸ If the main repo is very large and has long history it can consume large amount of space and lot of time to download.
  • 5. "I'M AN EGOTISTICAL BASTARD, AND I NAME ALL MY PROJECTS AFTER MYSELF. FIRST 'LINUX', NOW 'GIT'." Linus Torvalds
  • 6. GIT - HOW IT ALL BEGINS ▸ founded by Linus Torvalds and the Linux Kernel team ▸ From 1991 to 2002 modifications to linux kernel was kept in file system as patches. ▸ Linux moved to BitKeeper a proprietary DVCS in 2002. ▸ BitKeeper revoked the free usage for linux team, and Linux Kernel team started writing their own DVCS. ▸ so came the git , and the rest is history….
  • 8. INSTALLING GIT … ▸ Installing git - enough references are there in Google ▸ Installation methods are platform specific.
  • 9. UNDERSTANDING GIT CORE ▸ git is a content-addressable filesystem, bit like Unix. ▸ means that at the core of Git is a simple key-value data store. ▸ The key is a 40-character checksum hash. ▸ value can be different types of git objects. ▸ git Object types ▸ Tree Objects, Blob Objects, Commit Objects & Tag Objects
  • 10. UNDERSTANDING GIT CORE (CONTD.) ▸ Tree Objects represent the repository. (similar to a folder/ directory in a file system) ▸ Blob objects are the leafs , any file in the repository. (similar to files in a file system) ▸ Commit Objects the functional object of repository current status. ▸ Tag Objects categorise a commit object by naming it. ▸ A good reference ▸ https://git-scm.com/book/en/ v2/Git-Internals-Git-Objects
  • 11. CREATE YOUR GIT REPOSITORY ▸ Configure your git ▸ git config --global user.name "Your Name" ▸ git config --global user.email you@example.com ▸ Go in to your project and initialise a git repository. ▸ git init ▸ Add all the project directories and files to repository. ▸ git add . ▸ Now Commit all the added directories and files to git. ▸ git commit -m “<commit-message>”
  • 12. WHERE IS THE GIT REPOSITORY ? ▸ Its there along with the project files, look for a hidden file “.git” , a single folder , in the project root. ▸ The git repository contains ▸ Head file ▸ Objects ▸ branches ▸ logs and many more
  • 13. WHAT HAPPENS WHEN YOU ADD TO GIT ? ▸ Git Three Tree
  • 14. USEFUL GIT COMMANDS AT THIS STAGE ▸ git log - shows a log of all commits starting from HEAD back to the initial commit. ▸ git status - shows which files have changed between the current project state and HEAD. ▸ git diff - shows the diff between HEAD and the current project state. ▸ git mv and git rm - mark files to be moved (rename) and removed, respectively, much like git add.
  • 15. HOW DOES GIT COMMIT WORKS ? ▸ git commit is the current status of repository. ▸ Represented by the Commit Object, the commit object contains follows. ▸ The set of files currently available (changed/unchanged). ▸ Reference to parent commit (the SHA1 key of parent commit). ▸ The SHA1 name. ▸ git add will add files to the commit object, current versions of changed files, previous version of unchanged / un- added files.
  • 16. HOW DOES GIT COMMIT WORKS ? (CONTD.) ▸ git commit will submit the commit object, a commit is a snapshot of the repository. ▸ Now the “new commit object” is the current status of the git repository.
  • 17. GIT BRANCHING ▸ Manage drastic changes, new features. ▸ Manage a different copy of the “master” within same repository. which means another commit object. ▸ create a branch. ▸ git branch <name> ▸ Point HEAD to the new branch. ▸ git checkout <branch_name> ▸ Better to manage “trunk” & “branch” practice.
  • 18. GIT MERGING ▸ If we are merging the branch to master, set HEAD to master. And then merge ▸ git checkout master ▸ git merge <branch_name> ▸ Then do a new git commit.
  • 19. CONFLICT RESOLUTION ▸ At the point of merging , if master repository has changed from the ancestor commit, then conflicts can happen at the point of merging. ▸ Git will add conflict messages at exact points. ▸ Manually edit those locations and commit.
  • 20. COLLABORATIVE DEVELOPMENT ▸ Get someones git repository , ▸ git clone <repo_url> ▸ Create a remote repo reference named as “origin”. ▸ Then new heads will get created pointing to the header of remote repo, known as “remote heads” ▸ origin/master - for the master head ▸ origin/<branch> - for the branches
  • 21. COLLABORATIVE DEVELOPMENT (CONTD.) ▸ create your own branch to work on the remote repository branch. ▸ git branch --track [new-local-branch] [remote- branch] ▸ get updates from remote branch. ▸ git fetch origin ▸ Now update your local “master” and branches with the updates. ▸ git pull origin <master/branch_name>
  • 22. COLLABORATIVE DEVELOPMENT (CONTD.) ▸ To push your changes to remote repository “master” or branches. ▸ git push origin <master/branch_name>