SlideShare a Scribd company logo
1 of 34
Download to read offline
GIT
the stupid content tracker
Resources: Peep Code and Git-SCM
GIT
“In many ways you can just see git as a filesystem — it’s content-addressable, and it has a notion of
versioning, but I really really designed it coming at the problem from the viewpoint of a filesystem
person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional
SCM system.” – Linus
GIT as a SCM is an usecase
Non-SCM Use Cases of GIT:
Peer to Peer Content Distribution Network
Distributed Document Oriented Database [like wiki]
GIT
1. Non Linear Development - Cheap and efficient branching
2. Distributed Development - No repository is special
3. Efficiency - Fastness, Size & Network Operations
The GIT Way
1. Snapshots not differences
2. Nearly every operations are local.
3. Ensures Integrity.
4. Undo is always an option.
5. And the three states
GIT Setup
1. Setting up the origin
2. Setting up the local
GIT Tracking
GIT Tracking
1. Staging
2. Status
3. Viewing the diff
3.1 Working directory and Stage
3.2 Stage and a Commit
3.3 Working directory and a Commit
4. Remove
5. Move or Rename
6. Referencing
GIT Tracking
1. Commit
2. Undo
2.1 Checkout
2.2 Reset [hard, soft, mixed - default]
2.3 Revert
3. Working with remote
An interactive Demo
GIT Tracking
Ignores Files from
1. .gitignore from directories [like IDE Related Folders]
2. $GIT_DIR/info/exclude [Project Specific Setting like logs, binaries]
3. core.excludesfile [Stuffs needn’t be shared among developers]
GIT Tracking (Checkout vs Reset vs Revert)
GIT Objects
1. Blob
2. Tree
3. Commit
4. Tag
*3 in italics are important to understand git
GIT Objects
1. The Git Directory serves as the Git Object Database.
2. Each object is compressed and referenced by SHA-1 value of [Header + Content].
GIT Objects
tamil@dv-lp-tamil-s:~/gitdemo$ git init
Initialized empty Git repository in /home/tamil/gitdemo/.git/
tamil@dv-lp-tamil-s:~/gitdemo$ cd.git/
tamil@dv-lp-tamil-s:~/gitdemo/.git$ ll
total 40
drwxr-xr-x 7 tamil tamil 4096 Mar 24 17:25 ./
drwxr-xr-x 3 tamil tamil 4096 Mar 24 17:25 ../
drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 branches/
-rw-r--r-- 1 tamil tamil 92 Mar 24 17:25 config
-rw-r--r-- 1 tamil tamil 73 Mar 24 17:25 description
-rw-r--r-- 1 tamil tamil 23 Mar 24 17:25 HEAD
drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 hooks/
drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 info/
drwxr-xr-x 4 tamil tamil 4096 Mar 24 17:25objects/
drwxr-xr-x 4 tamil tamil 4096 Mar 24 17:25 refs/
GIT Objects [blob]
1. Stores Contents of files.
2. No file metadata.
3. Two different files with similar contents are marked one [even while transfers].
GIT Objects [tree]
1. List of trees and blobs [similar to ls -l in unix] + Some Header.
2. An entry in tree has mode, type, name and sha of file or another tree.
GIT Objects [commit]
1. Holds a reference to a tree object.
2. Has author, committer, message and any parent commits that directly preceded it.
3. History is built from the references to parent commits.
GIT Objects [tag]
1. Refers to one particular commit object.
2. Has object, type, tag, tagger and a message.
3. Mostly the type is commit and object referred is the SHA-1 of commit being tagged.
GIT Data Model
commit
tree
blob
HEAD
branch
remote tag
GIT Data Model [Demo]
…. Some
Action
Branching and Merging
1. Creating a branch is nothing more than just writing 40 characters to a file.
2. Add Remotes to point to other people copies.
Merge Types:
Fast Forward [--no-ff]
3-Way Merge
Merge Strategies:
Resolve
Recursive [Default for merging 2 branches]
Ours
Octopus [Default for merging from more than one branch]
Subtree
Merging [Fast Forward]
After Merge:
C0 C1 C3
Test
HEAD
C0 C1 C3
HEAD
Test
C0 C1
C3
HEAD
Test
C4
--no-ff Mode:
Merging [3-Way]
C0 C1 C3
C4
HEAD
Test
C0 C1 C3
C4
Test
C5
HEAD
Base Ours
Theirs
More Complex Merges
More Complex Merge [contd.]
GIT Tagging
1. Lightweight - Just a cheap reference to a commit
2. Annotated - More than a reference
Tags can be published or shared with other developers via push.
They aren’t pushed by default.
git-describe - Shows the most recent tag that is reachable from a
commit
GIT Stash
1. Helps switching to a different branch even when working directory isn’t clean.
2. Saves uncommitted changes [modified tracked files and staged changes] as WIP in
master.
3. Can be reapplied, dropped or applied on a new branch.
GIT Patches & Cherry Picks
1. Patches are alternate for merge or pull requests [SVN way].
2. Can Merge specific file from different branch or a commit using patch mode.
3. Cherry Pick helps in applying specific commit from same or another branch.
GIT Grep
File Grep:
git grep -e “isStringSet” *.js
Log Grep:
git log --grep=fix --author=tamil.s since=’yesterday’
GIT Log
List By (with stats or patches):
User
Time Limit [before, after, since and until]
Grep
Locate the introductory Commit
and many more..
Might take an year to explore ;)
GIT Workflows
Centralized Workflow
GIT Workflows
Integration manager
GIT Workflows
Benevolent Dictator
GIT Lab
1. Managing your profile
2. Creating a project
3. Managing Members
4. Code Reviews & Comments
5. Managing Issues + Milestones
6. Cool Commit Messages
7. Merge Requests
Questions

More Related Content

Recently uploaded

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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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 Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 

Recently uploaded (20)

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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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 Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

GIT Presentation

  • 1. GIT the stupid content tracker Resources: Peep Code and Git-SCM
  • 2. GIT “In many ways you can just see git as a filesystem — it’s content-addressable, and it has a notion of versioning, but I really really designed it coming at the problem from the viewpoint of a filesystem person (hey, kernels is what I do), and I actually have absolutely zero interest in creating a traditional SCM system.” – Linus GIT as a SCM is an usecase Non-SCM Use Cases of GIT: Peer to Peer Content Distribution Network Distributed Document Oriented Database [like wiki]
  • 3. GIT 1. Non Linear Development - Cheap and efficient branching 2. Distributed Development - No repository is special 3. Efficiency - Fastness, Size & Network Operations
  • 4. The GIT Way 1. Snapshots not differences 2. Nearly every operations are local. 3. Ensures Integrity. 4. Undo is always an option. 5. And the three states
  • 5. GIT Setup 1. Setting up the origin 2. Setting up the local
  • 7. GIT Tracking 1. Staging 2. Status 3. Viewing the diff 3.1 Working directory and Stage 3.2 Stage and a Commit 3.3 Working directory and a Commit 4. Remove 5. Move or Rename 6. Referencing
  • 8. GIT Tracking 1. Commit 2. Undo 2.1 Checkout 2.2 Reset [hard, soft, mixed - default] 2.3 Revert 3. Working with remote An interactive Demo
  • 9. GIT Tracking Ignores Files from 1. .gitignore from directories [like IDE Related Folders] 2. $GIT_DIR/info/exclude [Project Specific Setting like logs, binaries] 3. core.excludesfile [Stuffs needn’t be shared among developers]
  • 10. GIT Tracking (Checkout vs Reset vs Revert)
  • 11. GIT Objects 1. Blob 2. Tree 3. Commit 4. Tag *3 in italics are important to understand git
  • 12. GIT Objects 1. The Git Directory serves as the Git Object Database. 2. Each object is compressed and referenced by SHA-1 value of [Header + Content].
  • 13. GIT Objects tamil@dv-lp-tamil-s:~/gitdemo$ git init Initialized empty Git repository in /home/tamil/gitdemo/.git/ tamil@dv-lp-tamil-s:~/gitdemo$ cd.git/ tamil@dv-lp-tamil-s:~/gitdemo/.git$ ll total 40 drwxr-xr-x 7 tamil tamil 4096 Mar 24 17:25 ./ drwxr-xr-x 3 tamil tamil 4096 Mar 24 17:25 ../ drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 branches/ -rw-r--r-- 1 tamil tamil 92 Mar 24 17:25 config -rw-r--r-- 1 tamil tamil 73 Mar 24 17:25 description -rw-r--r-- 1 tamil tamil 23 Mar 24 17:25 HEAD drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 hooks/ drwxr-xr-x 2 tamil tamil 4096 Mar 24 17:25 info/ drwxr-xr-x 4 tamil tamil 4096 Mar 24 17:25objects/ drwxr-xr-x 4 tamil tamil 4096 Mar 24 17:25 refs/
  • 14. GIT Objects [blob] 1. Stores Contents of files. 2. No file metadata. 3. Two different files with similar contents are marked one [even while transfers].
  • 15. GIT Objects [tree] 1. List of trees and blobs [similar to ls -l in unix] + Some Header. 2. An entry in tree has mode, type, name and sha of file or another tree.
  • 16. GIT Objects [commit] 1. Holds a reference to a tree object. 2. Has author, committer, message and any parent commits that directly preceded it. 3. History is built from the references to parent commits.
  • 17. GIT Objects [tag] 1. Refers to one particular commit object. 2. Has object, type, tag, tagger and a message. 3. Mostly the type is commit and object referred is the SHA-1 of commit being tagged.
  • 19. GIT Data Model [Demo] …. Some Action
  • 20. Branching and Merging 1. Creating a branch is nothing more than just writing 40 characters to a file. 2. Add Remotes to point to other people copies. Merge Types: Fast Forward [--no-ff] 3-Way Merge Merge Strategies: Resolve Recursive [Default for merging 2 branches] Ours Octopus [Default for merging from more than one branch] Subtree
  • 21. Merging [Fast Forward] After Merge: C0 C1 C3 Test HEAD C0 C1 C3 HEAD Test C0 C1 C3 HEAD Test C4 --no-ff Mode:
  • 22. Merging [3-Way] C0 C1 C3 C4 HEAD Test C0 C1 C3 C4 Test C5 HEAD Base Ours Theirs
  • 24. More Complex Merge [contd.]
  • 25. GIT Tagging 1. Lightweight - Just a cheap reference to a commit 2. Annotated - More than a reference Tags can be published or shared with other developers via push. They aren’t pushed by default. git-describe - Shows the most recent tag that is reachable from a commit
  • 26. GIT Stash 1. Helps switching to a different branch even when working directory isn’t clean. 2. Saves uncommitted changes [modified tracked files and staged changes] as WIP in master. 3. Can be reapplied, dropped or applied on a new branch.
  • 27. GIT Patches & Cherry Picks 1. Patches are alternate for merge or pull requests [SVN way]. 2. Can Merge specific file from different branch or a commit using patch mode. 3. Cherry Pick helps in applying specific commit from same or another branch.
  • 28. GIT Grep File Grep: git grep -e “isStringSet” *.js Log Grep: git log --grep=fix --author=tamil.s since=’yesterday’
  • 29. GIT Log List By (with stats or patches): User Time Limit [before, after, since and until] Grep Locate the introductory Commit and many more.. Might take an year to explore ;)
  • 33. GIT Lab 1. Managing your profile 2. Creating a project 3. Managing Members 4. Code Reviews & Comments 5. Managing Issues + Milestones 6. Cool Commit Messages 7. Merge Requests