SlideShare a Scribd company logo
Presented By:
Md Swawibe Ul Alam
Junior Software Engineer
Nascenia Limited
Merge
Git Merge
 What it does?
Join two or more development histories/branches
together
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Git merge is 2 types:
 Fast forward
 No fast forward
Example : Fast-Forward Git Merge
 Let us assume that I created a topic
branch named speedup from the
current master. After working on this
branch for a while (three commits,
those white circles),I finally decided
that I am done and then I pushed it to
my own remote. Meanwhile, nothing
else happened in the master branch.
 Now if we use git merge using git fast-
forward then my work is landed on
the source tree. Because master has
not been changed since the commit
(gray circle).whole series of the
commits will be linear.
Example : Fast-Forward Git Merge
Example : No Fast-Forward Git Merge
 If we use -no-ff option (it stands for no
fast-forward). In this case, the history
looks slightly different (right side),
there is an additional commit (dotted
circle) emphasizing the merge
Advanced Git Presentation By Swawibe
Rebase
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Git Revert
 This command creates a new commit that undoes
the changes from a previous commit. This command
adds new history to the project (it doesn't modify
existing history)
 Use this to rollback changes you have committed
Git checkout
 Use this to checkout a branch or specific commit
 This will rollback any changes you have in your
working copy
 This will NOT make any changes to the history
Git reset
 Use this to rollback changes made to the index (eg:
from git add), which will NOT change the history.
 Use this to change what commit a head is pointing
to, which will change the history
Cherry Pick
 What git cherry-pick does, basically, is take a
commit from somewhere else, and "play it back"
wherever you are right now. Because this introduces
the same change with a different parent, Git builds a
new commit with a different ID
Cherry Pick : Example
❖ If you were at node H in this graph, and you typed git Cherry-pick E you'd
wind up with a copy of commit E—let's call it "E prime" or E'—that
pointed to H as its parent
❖ if you typed something like git cherry-pick C D E
Advanced Git Log
Advanced git log can be divided into two parts :
Formating log output
Filtering log output
Formating log output
 Formatting shows how each commit is displayed. Available
formats are-
 Oneline
 Decorating
 Diffs
 Shortlog
 Graph
 Custom formatting
Oneline
 The --oneline flag condenses each commit to a single
line.
 $ git log --oneline
 output:
0e25143 Merge branch 'feature'
ad8621a Fix a bug in the feature
16b36c6 Add a new feature
23ad9ad Add the initial code base
Decorating
 The --decorate flag makes git log display all of the
references (e.g., branches, tags, etc) that point to
each commit.
 $ git log --oneline --decorate
 output:
0e25143 (HEAD, master) Merge branch 'feature'
ad8621a (feature) Fix a bug in the feature
16b36c6 Add a new feature
23ad9ad (tag: v0.9) Add the initial code base
Diffs
 The git log command includes many options for displaying diffs with each
commit. Two of the most common options are -
 --stat
 The --stat option displays the number of insertions and deletions to each file altered by
each commit
 $ git log --stat
 output:
 commit f2a238924e89ca1d4947662928218a06d39068c3
Author: John <john@example.com>
Date: Fri Jun 25 17:30:28 2014 -0500
Add a new feature
hello.py | 105 ++++++++++++++++++++++++-----------------
1 file changed, 67 insertion(+), 38 deletions(-)
Diffs cont..
 -p
 To see the actual changes introduced by each commit, pass the -p option
to git log
 $ git log --stat -p
 output:
 commit 16b36c697eb2d24302f89aa22d9170dfe609855b
Author: Mary <mary@example.com>
Date: Fri Jun 25 17:31:57 2014 -0500
Fix a bug in the feature
diff --git a/hello.py b/hello.py
index 18ca709..c673b40 100644
--- a/hello.py
+++ b/hello.py
@@ -13,14 +13,14 @@ B
-print("Hello, World!")
+print("Hello, Git!")
Shortlog
 The git shortlog command is a special version of git
log intended for creating release announcements.
 It groups each commit by author and displays the
first line of each commit message
Shortlog cont..
$ git shortlog
output:
Mary (2):
Fix a bug in the feature
Fix a serious security hole in our framework
John (3):
Add the initial code base
Add a new feature
Merge branch 'feature'
Graph
 The --graph option draws an ASCII graph
representing the branch structure of the commit
history
 This is commonly used in conjunction with the --
oneline and --decorate
Graph cont..
$ git log --graph --oneline --decorate
output:
* 0e25143 (HEAD, master) Merge branch 'feature'
|
| * 16b36c6 Fix a bug in the new feature
| * 23ad9ad Start a new feature
* | ad8621a Fix a critical security issue
|/
* 400e4b7 Fix typos in the documentation
* 160e224 Add the initial code base
Custom formatting
 For all of your other git log formatting needs the --
pretty=format:"<string>" option.
 Display each commit however we want using printf-
style placeholders
Custom formatting cont
$ git log --pretty=format:"%cn committed %h on %cd"
output:
John committed 400e4b7 on Fri Jun 24 12:30:04 2014 -0500
John committed 89ab2cf on Thu Jun 23 17:09:42 2014 -0500
Mary committed 180e223 on Wed Jun 22 17:21:19 2014 -0500
John committed f12ca28 on Wed Jun 22 13:50:31 2014 -0500
Filtering Log Output
 Filtering shows which commits are included in the
output. Following commands are used for filtering-
 By Amount
 $ git log -3
 By Date
 $ git log --after="2014-7-1"
 $ git log --after="yesterday"
 $ git log --after="2014-7-1" --before="2014-7-4"
Filtering Log Output Cont..
 By Author
 $ git log --author="John"
 $ git log --author="John|Mary" //(Mary or John)
 By Message
 $ git log --grep="JRA-224:"
 By File
 git log -- foo.py bar.py
 By Content
 git log -S"Hello, World!"
Filtering Log Output Cont..
 By Range
 $ git log master..feature
 $ git log <since>..<until>
 Filtering Merge Commits
 $ git log --no-merges
 $ git log --merges
Md Swawibe Ul Alam
Ad

More Related Content

What's hot (20)

Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
Safique Ahmed Faruque
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Github basics
Github basicsGithub basics
Github basics
Radoslav Georgiev
 
Git
GitGit
Git
Gayan Kalanamith Mannapperuma
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
Sergiu-Ioan Ungur
 
Git l'essentiel
Git l'essentielGit l'essentiel
Git l'essentiel
Riadh MNASRI
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
Yoad Snapir
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
Emanuele Olivetti
 
Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)Git 더하기 GitHub(구름IDE 환경)
Git 더하기 GitHub(구름IDE 환경)
Junyoung Lee
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
GIT | Distributed Version Control System
GIT | Distributed Version Control SystemGIT | Distributed Version Control System
GIT | Distributed Version Control System
Mohammad Imam Hossain
 

Viewers also liked (17)

STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKSSTUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
Md Swawibe Ul Alam
 
Resume 2015.pptx may 28_2015 (1)
Resume 2015.pptx may 28_2015 (1)Resume 2015.pptx may 28_2015 (1)
Resume 2015.pptx may 28_2015 (1)
Melonie Bolton
 
MSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiselineMSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiseline
Marija Vukovic
 
12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ
AnastasiyaF
 
tirted.excited
tirted.excitedtirted.excited
tirted.excited
Eteri Rustamova
 
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed  Demeke, ETHIOPIA, May 2015Yirmed  Demeke, ETHIOPIA, May 2015
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed Demeke
 
Actividad 3 patricia sevillanos
Actividad 3 patricia sevillanosActividad 3 patricia sevillanos
Actividad 3 patricia sevillanos
Patty Sevillanos
 
Fakultät Wirtschaftswissenschaften
Fakultät WirtschaftswissenschaftenFakultät Wirtschaftswissenschaften
Fakultät Wirtschaftswissenschaften
Ms. Qamar
 
Electronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault AnalysisElectronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault Analysis
Md Swawibe Ul Alam
 
Comunicato stampa Assocontact
Comunicato stampa AssocontactComunicato stampa Assocontact
Comunicato stampa Assocontact
noi gepin contact
 
Layman's Guide to ISO8583
Layman's  Guide to ISO8583Layman's  Guide to ISO8583
Layman's Guide to ISO8583
Donald Yeo
 
ISO8583 MySQL UDF Manual
ISO8583 MySQL UDF ManualISO8583 MySQL UDF Manual
ISO8583 MySQL UDF Manual
sybond
 
Iso8583
Iso8583Iso8583
Iso8583
Duy Do Phan
 
الدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكنيالدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكني
Nour Elbader
 
ISO 8583 Financial Message Format
ISO 8583 Financial Message FormatISO 8583 Financial Message Format
ISO 8583 Financial Message Format
Md. Hasan Basri (Angel)
 
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip CardsReport on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Darshana Senavirathna
 
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
Nour Elbader
 
STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKSSTUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
STUDY ON ATM-POS SWITCHING SOFTWARE FOR BANKS
Md Swawibe Ul Alam
 
Resume 2015.pptx may 28_2015 (1)
Resume 2015.pptx may 28_2015 (1)Resume 2015.pptx may 28_2015 (1)
Resume 2015.pptx may 28_2015 (1)
Melonie Bolton
 
MSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiselineMSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiseline
Marija Vukovic
 
12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ
AnastasiyaF
 
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed  Demeke, ETHIOPIA, May 2015Yirmed  Demeke, ETHIOPIA, May 2015
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed Demeke
 
Actividad 3 patricia sevillanos
Actividad 3 patricia sevillanosActividad 3 patricia sevillanos
Actividad 3 patricia sevillanos
Patty Sevillanos
 
Fakultät Wirtschaftswissenschaften
Fakultät WirtschaftswissenschaftenFakultät Wirtschaftswissenschaften
Fakultät Wirtschaftswissenschaften
Ms. Qamar
 
Electronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault AnalysisElectronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault Analysis
Md Swawibe Ul Alam
 
Comunicato stampa Assocontact
Comunicato stampa AssocontactComunicato stampa Assocontact
Comunicato stampa Assocontact
noi gepin contact
 
Layman's Guide to ISO8583
Layman's  Guide to ISO8583Layman's  Guide to ISO8583
Layman's Guide to ISO8583
Donald Yeo
 
ISO8583 MySQL UDF Manual
ISO8583 MySQL UDF ManualISO8583 MySQL UDF Manual
ISO8583 MySQL UDF Manual
sybond
 
الدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكنيالدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكني
Nour Elbader
 
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip CardsReport on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Report on ISO8583,EDCPOS vs mPOS and EMV vs Magnetic Strip Cards
Darshana Senavirathna
 
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
Nour Elbader
 
Ad

Similar to Advanced Git Presentation By Swawibe (20)

GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
alignan
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
Andrej Koelewijn
 
Git: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesGit: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best Practices
Jeremy Leisy
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
Automat-IT
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Gittalk
GittalkGittalk
Gittalk
prtinsley
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Bitbucket
BitbucketBitbucket
Bitbucket
hariprasad1035
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
synapsefre
 
Git foundation
Git foundationGit foundation
Git foundation
Wee Keat Chin
 
Git Acquainted
Git AcquaintedGit Acquainted
Git Acquainted
tylerhunt
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
Git
GitGit
Git
Parag Gupta
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Codemotion
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
Gareth Hall
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
alignan
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Git: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesGit: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best Practices
Jeremy Leisy
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
Automat-IT
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
synapsefre
 
Git Acquainted
Git AcquaintedGit Acquainted
Git Acquainted
tylerhunt
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Codemotion
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
Gareth Hall
 
Ad

Recently uploaded (20)

Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 

Advanced Git Presentation By Swawibe

  • 1. Presented By: Md Swawibe Ul Alam Junior Software Engineer Nascenia Limited
  • 3. Git Merge  What it does? Join two or more development histories/branches together
  • 7. Git merge is 2 types:  Fast forward  No fast forward
  • 8. Example : Fast-Forward Git Merge  Let us assume that I created a topic branch named speedup from the current master. After working on this branch for a while (three commits, those white circles),I finally decided that I am done and then I pushed it to my own remote. Meanwhile, nothing else happened in the master branch.
  • 9.  Now if we use git merge using git fast- forward then my work is landed on the source tree. Because master has not been changed since the commit (gray circle).whole series of the commits will be linear. Example : Fast-Forward Git Merge
  • 10. Example : No Fast-Forward Git Merge  If we use -no-ff option (it stands for no fast-forward). In this case, the history looks slightly different (right side), there is an additional commit (dotted circle) emphasizing the merge
  • 22. Git Revert  This command creates a new commit that undoes the changes from a previous commit. This command adds new history to the project (it doesn't modify existing history)  Use this to rollback changes you have committed
  • 23. Git checkout  Use this to checkout a branch or specific commit  This will rollback any changes you have in your working copy  This will NOT make any changes to the history
  • 24. Git reset  Use this to rollback changes made to the index (eg: from git add), which will NOT change the history.  Use this to change what commit a head is pointing to, which will change the history
  • 25. Cherry Pick  What git cherry-pick does, basically, is take a commit from somewhere else, and "play it back" wherever you are right now. Because this introduces the same change with a different parent, Git builds a new commit with a different ID
  • 26. Cherry Pick : Example
  • 27. ❖ If you were at node H in this graph, and you typed git Cherry-pick E you'd wind up with a copy of commit E—let's call it "E prime" or E'—that pointed to H as its parent
  • 28. ❖ if you typed something like git cherry-pick C D E
  • 29. Advanced Git Log Advanced git log can be divided into two parts : Formating log output Filtering log output
  • 30. Formating log output  Formatting shows how each commit is displayed. Available formats are-  Oneline  Decorating  Diffs  Shortlog  Graph  Custom formatting
  • 31. Oneline  The --oneline flag condenses each commit to a single line.  $ git log --oneline  output: 0e25143 Merge branch 'feature' ad8621a Fix a bug in the feature 16b36c6 Add a new feature 23ad9ad Add the initial code base
  • 32. Decorating  The --decorate flag makes git log display all of the references (e.g., branches, tags, etc) that point to each commit.  $ git log --oneline --decorate  output: 0e25143 (HEAD, master) Merge branch 'feature' ad8621a (feature) Fix a bug in the feature 16b36c6 Add a new feature 23ad9ad (tag: v0.9) Add the initial code base
  • 33. Diffs  The git log command includes many options for displaying diffs with each commit. Two of the most common options are -  --stat  The --stat option displays the number of insertions and deletions to each file altered by each commit  $ git log --stat  output:  commit f2a238924e89ca1d4947662928218a06d39068c3 Author: John <[email protected]> Date: Fri Jun 25 17:30:28 2014 -0500 Add a new feature hello.py | 105 ++++++++++++++++++++++++----------------- 1 file changed, 67 insertion(+), 38 deletions(-)
  • 34. Diffs cont..  -p  To see the actual changes introduced by each commit, pass the -p option to git log  $ git log --stat -p  output:  commit 16b36c697eb2d24302f89aa22d9170dfe609855b Author: Mary <[email protected]> Date: Fri Jun 25 17:31:57 2014 -0500 Fix a bug in the feature diff --git a/hello.py b/hello.py index 18ca709..c673b40 100644 --- a/hello.py +++ b/hello.py @@ -13,14 +13,14 @@ B -print("Hello, World!") +print("Hello, Git!")
  • 35. Shortlog  The git shortlog command is a special version of git log intended for creating release announcements.  It groups each commit by author and displays the first line of each commit message
  • 36. Shortlog cont.. $ git shortlog output: Mary (2): Fix a bug in the feature Fix a serious security hole in our framework John (3): Add the initial code base Add a new feature Merge branch 'feature'
  • 37. Graph  The --graph option draws an ASCII graph representing the branch structure of the commit history  This is commonly used in conjunction with the -- oneline and --decorate
  • 38. Graph cont.. $ git log --graph --oneline --decorate output: * 0e25143 (HEAD, master) Merge branch 'feature' | | * 16b36c6 Fix a bug in the new feature | * 23ad9ad Start a new feature * | ad8621a Fix a critical security issue |/ * 400e4b7 Fix typos in the documentation * 160e224 Add the initial code base
  • 39. Custom formatting  For all of your other git log formatting needs the -- pretty=format:"<string>" option.  Display each commit however we want using printf- style placeholders
  • 40. Custom formatting cont $ git log --pretty=format:"%cn committed %h on %cd" output: John committed 400e4b7 on Fri Jun 24 12:30:04 2014 -0500 John committed 89ab2cf on Thu Jun 23 17:09:42 2014 -0500 Mary committed 180e223 on Wed Jun 22 17:21:19 2014 -0500 John committed f12ca28 on Wed Jun 22 13:50:31 2014 -0500
  • 41. Filtering Log Output  Filtering shows which commits are included in the output. Following commands are used for filtering-  By Amount  $ git log -3  By Date  $ git log --after="2014-7-1"  $ git log --after="yesterday"  $ git log --after="2014-7-1" --before="2014-7-4"
  • 42. Filtering Log Output Cont..  By Author  $ git log --author="John"  $ git log --author="John|Mary" //(Mary or John)  By Message  $ git log --grep="JRA-224:"  By File  git log -- foo.py bar.py  By Content  git log -S"Hello, World!"
  • 43. Filtering Log Output Cont..  By Range  $ git log master..feature  $ git log <since>..<until>  Filtering Merge Commits  $ git log --no-merges  $ git log --merges