SlideShare a Scribd company logo
Code is like poetry, and Git
helps us write it together,
beautifully and
collaboratively, one commit
at a time.
Srinjay Das Gupta
Google DSC’23 Web Dev Lead
Narula Institute of Technology
Intermediate Git
Concepts and Tools
Narula Institute of Technology
• Brief Introduction to Git
• Git Branches
• Merging
• Rebasing
• Merging Conflicts
• Remotes
• Forks
• Pull Requests
• Git Situational Tools
• All about Open Source
Agenda
Brief Introduction to Git
Narula Institute of Technology
What is Git?
What is Git?
Git is free and open source software for distributed version
control: tracking changes in any set of files, usually used for
coordinating work among programmers collaboratively
developing source code during software development.
Basic Git Commands
1. git init:
This command initialises a new git repository
2. git clone:
This command creates a copy of a remote
repository in your local machine
3. git push:
This command updates staged local changes to the
remote
4. git pull:
This command updates local machine with changes
made in the remote
Git Branches and how
to use them
Narula Institute of Technology
What are Branches?
How to Create, Rename
and Delete Branches
● Create: git branch
<branch name>
● Rename: git branch -m
<new branch name>
● Delete: git branch -d
<branch name>
Narula Institute Of Technology
What do we do after we
finished working on a
branch?
WE…
How do we Merge?
We merge by:
1. Checkout the target
branch
2. Run the command:
git merge <branch name>
Git Rebase
Narula Institute of Technology
Narula Institute of technology
How do we Rebase
● First we checkout the branch we want to
rebase
● Then we run the command:
git rebase <target branch name>
Merging vs Rebasing:
Merging Pros
● Preserves History 📑
● Better for Merge
Conflicts✅
● Easy to undo 🔄
Rebasing Pros
● Cleaner History 📃
● More readable graph 👀
● Tougher to resolve
conflicts ⚠️
Merge Conflicts
Narula Institute of Technology
Merge Conflicts Can Occur During
Merging a Branch Rebasing Cherry Picking
Remotes, Forks and
Pull Requests
Narula Institute of Technology
Remotes
● Git remotes are remote
repositories (like
GitHub) where you store
and synchronize copies of
your project.
Fork
● A clone of a git
repository, typically
hosted on a git hosting
service
Pull Request
● An event where a
contributor asks a repo
manager to review code
they wish to merge into a
project
● Also known as Merge
Request
Git Situational Tools
Situational Tools:
● Stashing
● Cherry Picking
● Squashing
What is Stashing?
Narula Institute of Technology
How to Stash and apply stashed changes?
Stashing Changes:
To stash unstaged changes, you
simply run the command: git
stash and it will store all the
changes in the stash stack.
There are two ways of applying
stashed changes:
● git stash apply: This
applies the most recent
stashed change to the
working directory but it
also keeps it stored in the
stash stack
● git stash pop: It does the
same work, but deletes it
from the stash stack
What is Cherry Picking?
Narula Institute of Technology
Git cherry-pick lets you
selectively apply
individual commits from
one branch to another.
Cherry Picking Illustration
Narula Institute of Technology
How to Cherry Pick
To cherry pick a commit we need the SHA of the commit(s).
This can be done by running a git log on the branch from
where to cherry pick.
Finally to cherry pick:
● Checkout the target branch
● Run: git cherry-pick <commitSHA>
● To cherry pick multiple commits, add the SHA ids of the
commits one by one and git will cherry pick them in the
order they are given in the command. Like:
git cherry-pick <commit1SHA> <commit2SHA> ...
Of course, your alternative is to copy-paste all your changes to
the new branch.
CAUTION ⚠️
Cherry Picking should be used
sparingly because:
● it can lead to merge
conflicts
● it can cause duplicate
commits on separate
branches
SQUASHING
Narula Institute of Technology
How to Squash
There are two ways to squash
commits:
● Interactive Rebase
git rebase -i <target
branch name>
● And “--squash” to “git
merge”, i.e.,
git merge --squash
WorkEx doesn’t require a
job letter. You just need a
laptop and a will to work.
Narula Institute of Technology
Rajdip Bhattacharya
Google DSC’23 Cloud & DevOps Lead
Open Source: The nice Parts
Narula Institute of Technology
Why Open-source? And why
should you do it?
● Open source encourages innovation through collaboration.
● It allows customers to know how the code works, facilitating the development
of the most innovative software.
● It allows reuse and recycling of code, making it easier to collaborate and
achieve goals, rather than to recreate the wheel.
● Open source communities
● Growth and networking
● Skill development
● Scope of full time offers
● Bounty
Narula Institute of Technology
Perks of Open Source
Community Questions
● How to find relevant projects
for our contributions?
● When learning a framework, how
can I gauge my readiness to
contribute to an open-source
project despite feeling
overwhelmed by real codebases?
THANKYOU

More Related Content

Similar to Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)

Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
François D'Agostini
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
upadhyay_25
 

Similar to Open Sprintera (Where Open Source Sparks a Sprint of Possibilities) (20)

Git github
Git githubGit github
Git github
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for Beginners
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 
Gn unify git
Gn unify gitGn unify git
Gn unify git
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Git and GitHub Info Session
Git and GitHub Info SessionGit and GitHub Info Session
Git and GitHub Info Session
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testers
 
Data science Git management
Data science Git managementData science Git management
Data science Git management
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
 
GDSC ZHCET GitHub Session.pdf
GDSC ZHCET GitHub Session.pdfGDSC ZHCET GitHub Session.pdf
GDSC ZHCET GitHub Session.pdf
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | Edureka
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
 

Recently uploaded

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Recently uploaded (20)

10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
A Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationA Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data Migration
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 

Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)

  • 1.
  • 2. Code is like poetry, and Git helps us write it together, beautifully and collaboratively, one commit at a time. Srinjay Das Gupta Google DSC’23 Web Dev Lead Narula Institute of Technology
  • 3. Intermediate Git Concepts and Tools Narula Institute of Technology
  • 4. • Brief Introduction to Git • Git Branches • Merging • Rebasing • Merging Conflicts • Remotes • Forks • Pull Requests • Git Situational Tools • All about Open Source Agenda
  • 5. Brief Introduction to Git Narula Institute of Technology
  • 7. What is Git? Git is free and open source software for distributed version control: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development.
  • 8. Basic Git Commands 1. git init: This command initialises a new git repository 2. git clone: This command creates a copy of a remote repository in your local machine 3. git push: This command updates staged local changes to the remote 4. git pull: This command updates local machine with changes made in the remote
  • 9. Git Branches and how to use them Narula Institute of Technology
  • 11.
  • 12. How to Create, Rename and Delete Branches ● Create: git branch <branch name> ● Rename: git branch -m <new branch name> ● Delete: git branch -d <branch name>
  • 13. Narula Institute Of Technology What do we do after we finished working on a branch? WE…
  • 14. How do we Merge? We merge by: 1. Checkout the target branch 2. Run the command: git merge <branch name>
  • 16. Narula Institute of technology How do we Rebase ● First we checkout the branch we want to rebase ● Then we run the command: git rebase <target branch name>
  • 17.
  • 18. Merging vs Rebasing: Merging Pros ● Preserves History 📑 ● Better for Merge Conflicts✅ ● Easy to undo 🔄 Rebasing Pros ● Cleaner History 📃 ● More readable graph 👀 ● Tougher to resolve conflicts ⚠️
  • 20. Merge Conflicts Can Occur During Merging a Branch Rebasing Cherry Picking
  • 21. Remotes, Forks and Pull Requests Narula Institute of Technology
  • 22. Remotes ● Git remotes are remote repositories (like GitHub) where you store and synchronize copies of your project.
  • 23. Fork ● A clone of a git repository, typically hosted on a git hosting service
  • 24. Pull Request ● An event where a contributor asks a repo manager to review code they wish to merge into a project ● Also known as Merge Request
  • 26. Situational Tools: ● Stashing ● Cherry Picking ● Squashing
  • 27. What is Stashing? Narula Institute of Technology
  • 28. How to Stash and apply stashed changes? Stashing Changes: To stash unstaged changes, you simply run the command: git stash and it will store all the changes in the stash stack. There are two ways of applying stashed changes: ● git stash apply: This applies the most recent stashed change to the working directory but it also keeps it stored in the stash stack ● git stash pop: It does the same work, but deletes it from the stash stack
  • 29. What is Cherry Picking? Narula Institute of Technology
  • 30. Git cherry-pick lets you selectively apply individual commits from one branch to another. Cherry Picking Illustration Narula Institute of Technology
  • 31. How to Cherry Pick To cherry pick a commit we need the SHA of the commit(s). This can be done by running a git log on the branch from where to cherry pick. Finally to cherry pick: ● Checkout the target branch ● Run: git cherry-pick <commitSHA> ● To cherry pick multiple commits, add the SHA ids of the commits one by one and git will cherry pick them in the order they are given in the command. Like: git cherry-pick <commit1SHA> <commit2SHA> ...
  • 32. Of course, your alternative is to copy-paste all your changes to the new branch.
  • 33. CAUTION ⚠️ Cherry Picking should be used sparingly because: ● it can lead to merge conflicts ● it can cause duplicate commits on separate branches
  • 35. How to Squash There are two ways to squash commits: ● Interactive Rebase git rebase -i <target branch name> ● And “--squash” to “git merge”, i.e., git merge --squash
  • 36. WorkEx doesn’t require a job letter. You just need a laptop and a will to work. Narula Institute of Technology Rajdip Bhattacharya Google DSC’23 Cloud & DevOps Lead
  • 37. Open Source: The nice Parts Narula Institute of Technology
  • 38. Why Open-source? And why should you do it? ● Open source encourages innovation through collaboration. ● It allows customers to know how the code works, facilitating the development of the most innovative software. ● It allows reuse and recycling of code, making it easier to collaborate and achieve goals, rather than to recreate the wheel.
  • 39.
  • 40. ● Open source communities ● Growth and networking ● Skill development ● Scope of full time offers ● Bounty Narula Institute of Technology Perks of Open Source
  • 41. Community Questions ● How to find relevant projects for our contributions? ● When learning a framework, how can I gauge my readiness to contribute to an open-source project despite feeling overwhelmed by real codebases?

Editor's Notes

  1. As web developers, mastering Git is essential. Today, we'll explore this invaluable tool, breaking down its magic and transforming you from a solo coder to a collaborative rockstar! Forget confusion, embrace clarity, and let's write code that shines even when we're working in different time zones.