SlideShare a Scribd company logo
GIT ADVANCED
Version control System
WHAT IS GIT & IT’S ADVANTAGES
➤ Git is a version control system that
helps you manage and save your
changes over time. Developed in
2005 by Linus Torvalds, the
famous creator of the Linux
operating system kernel.
Advantages:
➤ Complete long term change
history for all file.
➤ Being able to trace each change
made.
➤ Allow multiple team members to
collaborate on same code.
➤ Provide backup copy.
`
➤ Git basics (Git setup and server integration).
➤ Git branches and merging.
➤ Undoing things (Manipulating git history
snapshot).
➤ Making open source contribution.
➤ Various Git workflows & git hooks.
➤ Useful Git tools.
GIT BASIC (GIT SETUP AND SERVER INTEGRATION)
— Create a git repo.
— Cloning a git repo.
— Setting git config
creating commands alias
git config user.name
git config user.name "Sahil Gupta"
git config --global alias.ci commit
git config credential.helper store
— add changes to git repo.
— checking git status
— committing your changes.
— Pushing your changes to remote.
— Create new branches
— checkout a new branch
— Doing above 2 steps in one.
GIT BASIC (GIT SETUP AND SERVER INTEGRATION) CONTINUED…
— Fetching a remote changes.
— Delete branches.
— Stash changes
— getting back the stash changes into any branch
— checking git history
GIT LOG:
— git log , git log -n, git log -p, git log <file>, git log —graph,
git log --graph --decorate --oneline, git log --author="Sahil”,
git shortlog, git log --after="2014-7-1" --before="2014-7-4”,
git log --author="John”, git log -- foo.py bar.py, git log master..feature
Git Stash:
— git stash, git stash save <msg>, git stash pop [stash@{2}], git stash apply, git stash
list, git stash show, git stash show -p, git stash drop [stash@{2}], git stash clear
GIT BASIC (GIT SETUP AND SERVER INTEGRATION) CONTINUED…
GITIGNORE:
— .gitignore [Use glowing pattern]
**/logs
.log
/debug.log
logs/
— adding comment # ignore all logs
— Adding multiple .gitignore
— Ignoring a previous committed files
edit .gitignore && git rm --cached debug.log
— *.log !debug.log. Ignore pattern with an exception
— collection of useful gitignore templates
https://github.com/github/gitignore
GIT BRANCHES AND MERGING
— Create a new branch.
— Switch between the branches.
— Delete unwanted branches.
— How to move changes between branches.
— rebase & merging
— Merging branches.
(i). Fast forward merging.
(ii). 3 way merging.
— what is —no-ff in merging
— Merging specific commit
git cherry-pick <SHA ID>
UNDOING THINGS(VIEWING AND MANIPULATING HISTORY)
— Viewing git history (git log).
— Go back to some previous commit state.
— How we run into “Detached Head” state.
— Remove untracked changes.
— Remove stagged changes.
— Remove committed changes.
— Remove commits from Remote branch.
Associated Commands:
checkout, clean,revert,reset
MAKING OPEN SOURCE CONTRIBUTION
— Fork a repo.
— Clone local copy of Repo.
— Make changes and push it to forked copy.
— Create pull request.
— Finally wait for approver to accept/reject your pull request.
GIT WORFLOWS & GIT HOOKS
Major different git workflow:
— Centralised workflow.
— Feature branches workflow.
— Gitflow workflow.
— Forking Workflow.
Git Hooks:
— scripts can be be written in any scripting languages. Most
popular language used are shell, Python and perl.
— First script line defines the interpreter
#!/bin/sh : shell
#!/usr/bin/env python : Pathon
— Git hooks are local in scope. You can share it by adding it
outside .git, template directory or creating sum links.
Git hooks continued….
— Local Hooks
• pre-commit
• prepare-commit-msg
• commit-msg
• post-commit
• post-checkout
• pre-rebase
— Server side Hooks:
• pre-receive
• update
• post-receive
GIT GUI TOOLS
Built in tools:
— gitk& git-gui
Third Party Tools:
— SourceTree
— Meld
— Git kraken
Reference : https://git-scm.com/downloads/guis/
GIT TIPS AND DISCUSSION
— Difference between Fetch and Pull.
— Difference between merge and rebase
— Difference between git log and git status
— Difference between git reset —hard vs git reset —soft vs git
reset —mixed
— Force push and issues in it.
— How to combine multiple commit, git reset —soft <sha-1 hash>
— Rewriting history/How to change last commit with new
changes.
Advanted git
Ad

More Related Content

What's hot (20)

Fall18 Git presentation
Fall18 Git presentationFall18 Git presentation
Fall18 Git presentation
JustinTirrell1
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
Gareth Hall
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
Jon Senchyna
 
Git: basic to advanced
Git: basic to advancedGit: basic to advanced
Git: basic to advanced
Yodalee
 
Git and fundamentals
Git and fundamentalsGit and fundamentals
Git and fundamentals
Naincy Gupta
 
Git Gyan
Git GyanGit Gyan
Git Gyan
Ravishankar S R
 
Git 101
Git 101Git 101
Git 101
jayrparro
 
Git
GitGit
Git
Hanokh Aloni
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Pham Quy (Jack)
 
Getting started with git
Getting started with gitGetting started with git
Getting started with git
Pawan Kumar.v
 
Git Tricks
Git TricksGit Tricks
Git Tricks
Ivelina Dimova
 
Git.odp 0
Git.odp 0Git.odp 0
Git.odp 0
Mannu Malhotra
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Colin Su
 
Basic git
Basic gitBasic git
Basic git
Casper Chen
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
mobaires
 
Git 101
Git 101Git 101
Git 101
Kate Semizhon
 
Git tech talk
Git tech talkGit tech talk
Git tech talk
razasayed
 
Version Control System - Git
Version Control System - GitVersion Control System - Git
Version Control System - Git
Carlo Bernaschina
 
Git presentation
Git presentationGit presentation
Git presentation
Vikas Yaligar
 

Similar to Advanted git (20)

Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
 
Git and Github
Git and GithubGit and Github
Git and Github
Teodora Ahkozidou
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
Git hub
Git hubGit hub
Git hub
Nitin Goel
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
Nyros Technologies
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
Gorav Singal
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
KeerthanaJ32
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
GDSCGHRIETNagpur
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
Learn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levelsLearn Git - For Beginners and Intermediate levels
Learn Git - For Beginners and Intermediate levels
Gorav Singal
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
Dídac Ríos
 
Bedjango talk about Git & GitHub
Bedjango talk about Git & GitHubBedjango talk about Git & GitHub
Bedjango talk about Git & GitHub
BeDjango
 
Ad

Recently uploaded (20)

Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Ad

Advanted git

  • 2. WHAT IS GIT & IT’S ADVANTAGES ➤ Git is a version control system that helps you manage and save your changes over time. Developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. Advantages: ➤ Complete long term change history for all file. ➤ Being able to trace each change made. ➤ Allow multiple team members to collaborate on same code. ➤ Provide backup copy.
  • 3. ` ➤ Git basics (Git setup and server integration). ➤ Git branches and merging. ➤ Undoing things (Manipulating git history snapshot). ➤ Making open source contribution. ➤ Various Git workflows & git hooks. ➤ Useful Git tools.
  • 4. GIT BASIC (GIT SETUP AND SERVER INTEGRATION) — Create a git repo. — Cloning a git repo. — Setting git config creating commands alias git config user.name git config user.name "Sahil Gupta" git config --global alias.ci commit git config credential.helper store — add changes to git repo. — checking git status — committing your changes. — Pushing your changes to remote. — Create new branches — checkout a new branch — Doing above 2 steps in one.
  • 5. GIT BASIC (GIT SETUP AND SERVER INTEGRATION) CONTINUED… — Fetching a remote changes. — Delete branches. — Stash changes — getting back the stash changes into any branch — checking git history GIT LOG: — git log , git log -n, git log -p, git log <file>, git log —graph, git log --graph --decorate --oneline, git log --author="Sahil”, git shortlog, git log --after="2014-7-1" --before="2014-7-4”, git log --author="John”, git log -- foo.py bar.py, git log master..feature Git Stash: — git stash, git stash save <msg>, git stash pop [stash@{2}], git stash apply, git stash list, git stash show, git stash show -p, git stash drop [stash@{2}], git stash clear
  • 6. GIT BASIC (GIT SETUP AND SERVER INTEGRATION) CONTINUED… GITIGNORE: — .gitignore [Use glowing pattern] **/logs .log /debug.log logs/ — adding comment # ignore all logs — Adding multiple .gitignore — Ignoring a previous committed files edit .gitignore && git rm --cached debug.log — *.log !debug.log. Ignore pattern with an exception — collection of useful gitignore templates https://github.com/github/gitignore
  • 7. GIT BRANCHES AND MERGING — Create a new branch. — Switch between the branches. — Delete unwanted branches. — How to move changes between branches. — rebase & merging — Merging branches. (i). Fast forward merging. (ii). 3 way merging. — what is —no-ff in merging — Merging specific commit git cherry-pick <SHA ID>
  • 8. UNDOING THINGS(VIEWING AND MANIPULATING HISTORY) — Viewing git history (git log). — Go back to some previous commit state. — How we run into “Detached Head” state. — Remove untracked changes. — Remove stagged changes. — Remove committed changes. — Remove commits from Remote branch. Associated Commands: checkout, clean,revert,reset
  • 9. MAKING OPEN SOURCE CONTRIBUTION — Fork a repo. — Clone local copy of Repo. — Make changes and push it to forked copy. — Create pull request. — Finally wait for approver to accept/reject your pull request.
  • 10. GIT WORFLOWS & GIT HOOKS Major different git workflow: — Centralised workflow. — Feature branches workflow. — Gitflow workflow. — Forking Workflow. Git Hooks: — scripts can be be written in any scripting languages. Most popular language used are shell, Python and perl. — First script line defines the interpreter #!/bin/sh : shell #!/usr/bin/env python : Pathon — Git hooks are local in scope. You can share it by adding it outside .git, template directory or creating sum links.
  • 11. Git hooks continued…. — Local Hooks • pre-commit • prepare-commit-msg • commit-msg • post-commit • post-checkout • pre-rebase — Server side Hooks: • pre-receive • update • post-receive
  • 12. GIT GUI TOOLS Built in tools: — gitk& git-gui Third Party Tools: — SourceTree — Meld — Git kraken Reference : https://git-scm.com/downloads/guis/
  • 13. GIT TIPS AND DISCUSSION — Difference between Fetch and Pull. — Difference between merge and rebase — Difference between git log and git status — Difference between git reset —hard vs git reset —soft vs git reset —mixed — Force push and issues in it. — How to combine multiple commit, git reset —soft <sha-1 hash> — Rewriting history/How to change last commit with new changes.