SlideShare ist ein Scribd-Unternehmen logo
1 von 32
GIT
By K. Ravi Rohith
CONTENTS
• INTRODUCTION TO GIT
• HISTORY OF GIT
• VERSION CONTROL SYSTEM
• GETTING STARTED TO GIT
• GIT UTILITY COMMANDS
• BRANCHING
• MERGING
• REBASE
• SUMMARY
INTRO TO GIT
• GIT is a Distributed Version Control System.
• It is a content addressable file system, used to track directory trees.
• It handles all the things like merging of source code and maintaining
versions.
• GIT is optimized for Complex Merges and Fast.
• It follows Trunk Base Development.
• It allows for code collaboration with anyone online.
GIT HISTORY
• Linus uses BitKeeper to manage Linux code
• In 2005, BitKeeper suddenly became unavailable.
• Linus decided to create a tool with Distributed Source Management
System.
• Linus Torvalds developed GIT in June 2005.
TERMINOLOGY
• DIRECTORY : A folder is used for storing multiple files.
• REPOSITORY : A collection of all the files and their history organized in folders,
branches, tags.
• CLONE : Act of copying a repository from a remote server.
• BRANCH : It is a pointer to a commit(save the files).
• MERGE : Combination of one or more branches into the current branch.
• ORIGIN : The default name of the remote repository.
• MASTER : It is just another branch, but is the default one which gets created.
• STAGE FILES : These are the files we have told GIT that are ready to committed.
• SNAPSHOT : In general is just the "entity" that git uses to store its data.
• INTEGRATORS : It can review and bring changes to reference code asynchronously to
central repository.
VERSION CONTROL SYSTEM
• Version Control System (VCS) is a software that helps software developers to work
together and maintain a complete history of their work.
• Version Control, also known as Revision Control or Source Control.
Functions of a Version Control System :
• Allows developers to work simultaneously.
• Maintains a history of every version.
• Does not allow overwriting each other’s changes.
Following are the types of Version Control System :
• Centralized version control system (CVCS).
• Distributed/Decentralized version control system (DVCS).
CENTRALIZED VERSION CONTROL SYSTEM
• Centralized version control system (CVCS) uses a central server to store all files and
enables team collaboration.
• “Committing” a change simply means recording the change in the central system
and Other programmers can then see this change.
• They can also pull down the change, and the version control tool will automatically
update the contents of any files that were changed.
• It is a Client-Server approach.
CENTRALIZED VERSION CONTROL WORKFLOW
When you’re working with a Centralized Version Control System, your
workflow for adding a new feature or fixing a bug in your project will
usually look something like this:
• Pull down any changes other people have made from the central server.
• Make your changes, and make sure they work properly.
• Commit your changes to the central server, so other programmers can
see them.
DISADVANTAGES OF CENTRALIZED VERSION CONTROL
• Merging of files or code is difficult.
• A single point of failure i.e., failure of the central server.
• Remote Server commits slow while transferring data.
• Unsolicited changes that may break your project.
DISTURBUTED VERSION CONTROL SYSTEM
• Distributed Version Control System (DVCS) is a form of version control that
allows software developers to work on a given project without requiring them
to share a common network.
• Distributed version control takes a peer to peer approach.
• It synchronizes repositories by exchanging patches (sets of changes) from
peer to peer.
Advantages of Distributed Version Control System
• Don’t require any common network
• DVCS is fast because it not rely on central server.
• In Implicit Backup, data present on any client side mirrors the repository,
hence it can be used in the event of a crash or disk corruption.
• Security is more. It uses a common cryptographic hash function called secure
hash function.
• Easy to create branches because DVCS is branch management system.
DVCS TERMINOLOGIES
• Local Repository – it is a private workplace
• Working Directory – the place where files are checked out.
• Blob – stands for Binary Large Object. Each version of a file is
represented by blob.
• Tree - Tree is an object, which represents a directory. It holds blobs as
well as other sub-directories.
• Revision - Revision represents the version of the source code. Revisions in Git
are represented by commits.
• Tags – It assigns a meaningful name with a specific version in the repository. It
is immutable.
GETTING STARTED
Git is a version control system for tracking changes in computer files and
coordinating work on those files among multiple people.
• Three trees of Git
– The HEAD
• last commit snapshot, next parent
– Index
• Proposed next commit snapshot
– Working directory
• Sandbox
WORKFLOW OF GIT
• Init a repo – To initialize the repository in GIT : Git init
• Edit files
• Stage the changes
• Review your changes
• Commit the changes
Getting Started
• A basic workflow
– Edit files
– Stage the changes
– Review your changes
– Commit the changes
Use your favorite editor
15
Getting Started
• A basic workflow
– Edit files
– Stage the changes
– Review your changes
– Commit the changes
• Git add filename
16
• A basic workflow
– Edit files
– Stage the changes
– Review your changes
– Commit the changes
• Git status
17
Getting Started
Getting Started
• A basic workflow
– Edit files
– Stage the changes
– Review your changes
– Commit the changes
Git commit
18
Other GIT Utility commands
• git gc – garbage collector (run it when the /.git/ directory
takes too much space).
• git stash – save/restore the state of the working copy
and index.
• git clean – clean the working tree.
• git bisect – locating which commit introduced a bug.
• git cherry-pick – merging a single commit.
• git revert – canceling a previous commit
BRANCHING
• It is a pointer to a commit(save the files).
• The default branch name in Git is master.
• ‘git branch’ command used for create, rename, list and delete files.
20
USAGE
• git branch – List all of the branches in your repository.
• git branch <branch> – To create a new branch called <branch>.
• git branch -d <branch> – To delete the branch.
• git branch -m <branch> – To rename the current branch.
• git branch –merged – To display all branches that are already merged.
• git branch –a –color – it will be shown in appropriate colors to all
branches.
git branch -a --color
USAGE
• Git checkout
– lets you navigate between the
branches created by git branch.
MERGE
• Combining one ore more branches into the current branch.
• Allows changes from other branches to be integrated into the current
work history
• Merge only changes the workspace.
• If we commit in branch, other branches not affected
Features
– Fast Forward Merge
– 3 way Merge
23
24
MERGING
EXAMPLE Adding new branch to experiment
25
Committing the branch to repository Finally it navigates all the branches
in directory.
MERGING - CONFLICTS
• When merging, if there are conflicts - need to solve them.
• After solving, need to “add” the changes and commit the merged
workspace.
Working with remote Local file system
• Pros
– Simple
– Support existing access control
– NFS enabled
• Cons
– Public share is difficult to set up
– Slow on top of NFS
27
Working with remote GIT
• Pros
– Fastest protocol
– Allow public anonymous access
• Cons
– Lack of authentication
– Difficult to set up
28
Working With Remote
• Remote branching
– Branch on remote are different
from local branch
– Git fetch origin to get remote
changes
– Git pull origin try to fetch
remote changes and merge it
onto current branch.
– Git push means share your work
done on branch to remote
29
REBASE
• Instead of merging, replays set of changes on top of another branch
• Affects the “rebased” branch only
• Very useful to remove history clutter
• Simple rule, use locally only and for branches which you will never
share
SUMMARY
• Git is complex, but flexible and powerful.
• Git supports distributed teams very well.
• Due to it’s flexibility, every team needs to decide on the workflow which
works best for it.
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategiesjstack
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHubNishan Bose
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Gitramubonkuri
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version ControlSourabh Sahu
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 

Was ist angesagt? (20)

Git training v10
Git training v10Git training v10
Git training v10
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git basic
Git basicGit basic
Git basic
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Version control system and Git
Version control system and GitVersion control system and Git
Version control system and Git
 
Learning git
Learning gitLearning git
Learning git
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 
Git flow
Git flowGit flow
Git flow
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
 
Version control
Version controlVersion control
Version control
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 

Ähnlich wie GIT INTRODUCTION

Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitSahil Agarwal
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs githubVinoth Kannan
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptxEshaan35
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps JumpstartOri Donner
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubEdureka!
 

Ähnlich wie GIT INTRODUCTION (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git
GitGit
Git
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git SVN Migrate Reasons
Git SVN Migrate ReasonsGit SVN Migrate Reasons
Git SVN Migrate Reasons
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git theory
Git   theoryGit   theory
Git theory
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
Git 101
Git 101Git 101
Git 101
 
Svn vs mercurial vs github
Svn  vs  mercurial vs  githubSvn  vs  mercurial vs  github
Svn vs mercurial vs github
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
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
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhub
 
Git
GitGit
Git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 

Kürzlich hochgeladen

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

GIT INTRODUCTION

  • 1. GIT By K. Ravi Rohith
  • 2. CONTENTS • INTRODUCTION TO GIT • HISTORY OF GIT • VERSION CONTROL SYSTEM • GETTING STARTED TO GIT • GIT UTILITY COMMANDS • BRANCHING • MERGING • REBASE • SUMMARY
  • 3. INTRO TO GIT • GIT is a Distributed Version Control System. • It is a content addressable file system, used to track directory trees. • It handles all the things like merging of source code and maintaining versions. • GIT is optimized for Complex Merges and Fast. • It follows Trunk Base Development. • It allows for code collaboration with anyone online.
  • 4. GIT HISTORY • Linus uses BitKeeper to manage Linux code • In 2005, BitKeeper suddenly became unavailable. • Linus decided to create a tool with Distributed Source Management System. • Linus Torvalds developed GIT in June 2005.
  • 5. TERMINOLOGY • DIRECTORY : A folder is used for storing multiple files. • REPOSITORY : A collection of all the files and their history organized in folders, branches, tags. • CLONE : Act of copying a repository from a remote server. • BRANCH : It is a pointer to a commit(save the files). • MERGE : Combination of one or more branches into the current branch. • ORIGIN : The default name of the remote repository. • MASTER : It is just another branch, but is the default one which gets created. • STAGE FILES : These are the files we have told GIT that are ready to committed. • SNAPSHOT : In general is just the "entity" that git uses to store its data. • INTEGRATORS : It can review and bring changes to reference code asynchronously to central repository.
  • 6. VERSION CONTROL SYSTEM • Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. • Version Control, also known as Revision Control or Source Control. Functions of a Version Control System : • Allows developers to work simultaneously. • Maintains a history of every version. • Does not allow overwriting each other’s changes. Following are the types of Version Control System : • Centralized version control system (CVCS). • Distributed/Decentralized version control system (DVCS).
  • 7. CENTRALIZED VERSION CONTROL SYSTEM • Centralized version control system (CVCS) uses a central server to store all files and enables team collaboration. • “Committing” a change simply means recording the change in the central system and Other programmers can then see this change. • They can also pull down the change, and the version control tool will automatically update the contents of any files that were changed. • It is a Client-Server approach.
  • 8. CENTRALIZED VERSION CONTROL WORKFLOW When you’re working with a Centralized Version Control System, your workflow for adding a new feature or fixing a bug in your project will usually look something like this: • Pull down any changes other people have made from the central server. • Make your changes, and make sure they work properly. • Commit your changes to the central server, so other programmers can see them.
  • 9. DISADVANTAGES OF CENTRALIZED VERSION CONTROL • Merging of files or code is difficult. • A single point of failure i.e., failure of the central server. • Remote Server commits slow while transferring data. • Unsolicited changes that may break your project.
  • 10. DISTURBUTED VERSION CONTROL SYSTEM • Distributed Version Control System (DVCS) is a form of version control that allows software developers to work on a given project without requiring them to share a common network. • Distributed version control takes a peer to peer approach. • It synchronizes repositories by exchanging patches (sets of changes) from peer to peer.
  • 11. Advantages of Distributed Version Control System • Don’t require any common network • DVCS is fast because it not rely on central server. • In Implicit Backup, data present on any client side mirrors the repository, hence it can be used in the event of a crash or disk corruption. • Security is more. It uses a common cryptographic hash function called secure hash function. • Easy to create branches because DVCS is branch management system.
  • 12. DVCS TERMINOLOGIES • Local Repository – it is a private workplace • Working Directory – the place where files are checked out. • Blob – stands for Binary Large Object. Each version of a file is represented by blob. • Tree - Tree is an object, which represents a directory. It holds blobs as well as other sub-directories. • Revision - Revision represents the version of the source code. Revisions in Git are represented by commits. • Tags – It assigns a meaningful name with a specific version in the repository. It is immutable.
  • 13. GETTING STARTED Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. • Three trees of Git – The HEAD • last commit snapshot, next parent – Index • Proposed next commit snapshot – Working directory • Sandbox
  • 14. WORKFLOW OF GIT • Init a repo – To initialize the repository in GIT : Git init • Edit files • Stage the changes • Review your changes • Commit the changes
  • 15. Getting Started • A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Use your favorite editor 15
  • 16. Getting Started • A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes • Git add filename 16
  • 17. • A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes • Git status 17 Getting Started
  • 18. Getting Started • A basic workflow – Edit files – Stage the changes – Review your changes – Commit the changes Git commit 18
  • 19. Other GIT Utility commands • git gc – garbage collector (run it when the /.git/ directory takes too much space). • git stash – save/restore the state of the working copy and index. • git clean – clean the working tree. • git bisect – locating which commit introduced a bug. • git cherry-pick – merging a single commit. • git revert – canceling a previous commit
  • 20. BRANCHING • It is a pointer to a commit(save the files). • The default branch name in Git is master. • ‘git branch’ command used for create, rename, list and delete files. 20
  • 21. USAGE • git branch – List all of the branches in your repository. • git branch <branch> – To create a new branch called <branch>. • git branch -d <branch> – To delete the branch. • git branch -m <branch> – To rename the current branch. • git branch –merged – To display all branches that are already merged. • git branch –a –color – it will be shown in appropriate colors to all branches. git branch -a --color
  • 22. USAGE • Git checkout – lets you navigate between the branches created by git branch.
  • 23. MERGE • Combining one ore more branches into the current branch. • Allows changes from other branches to be integrated into the current work history • Merge only changes the workspace. • If we commit in branch, other branches not affected Features – Fast Forward Merge – 3 way Merge 23
  • 24. 24 MERGING EXAMPLE Adding new branch to experiment
  • 25. 25 Committing the branch to repository Finally it navigates all the branches in directory.
  • 26. MERGING - CONFLICTS • When merging, if there are conflicts - need to solve them. • After solving, need to “add” the changes and commit the merged workspace.
  • 27. Working with remote Local file system • Pros – Simple – Support existing access control – NFS enabled • Cons – Public share is difficult to set up – Slow on top of NFS 27
  • 28. Working with remote GIT • Pros – Fastest protocol – Allow public anonymous access • Cons – Lack of authentication – Difficult to set up 28
  • 29. Working With Remote • Remote branching – Branch on remote are different from local branch – Git fetch origin to get remote changes – Git pull origin try to fetch remote changes and merge it onto current branch. – Git push means share your work done on branch to remote 29
  • 30. REBASE • Instead of merging, replays set of changes on top of another branch • Affects the “rebased” branch only • Very useful to remove history clutter • Simple rule, use locally only and for branches which you will never share
  • 31. SUMMARY • Git is complex, but flexible and powerful. • Git supports distributed teams very well. • Due to it’s flexibility, every team needs to decide on the workflow which works best for it.