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
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
Rebase
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

More Related Content

What's hot

Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
Behzad Altaf
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git and github
Git and githubGit and github
Git and github
Sayantika Banik
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
git and github
git and githubgit and github
git and github
Darren Oakley
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
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 Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
Emanuele Olivetti
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
Otto Kekäläinen
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 

What's hot (20)

Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Git and github
Git and githubGit and github
Git and github
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
git and github
git and githubgit and github
git and github
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
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
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 

Viewers also liked

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 kiselineMarija Vukovic
 
12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ
AnastasiyaF
 
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed  Demeke, ETHIOPIA, May 2015Yirmed  Demeke, ETHIOPIA, May 2015
Yirmed Demeke, ETHIOPIA, May 2015Yirmed 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 WirtschaftswissenschaftenMs. 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 Manualsybond
 
الدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكنيالدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكني
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)
 
Exploring Payment Platforms - ISO 20022 and ISO 8583
Exploring Payment Platforms - ISO 20022 and ISO 8583Exploring Payment Platforms - ISO 20022 and ISO 8583
Exploring Payment Platforms - ISO 20022 and ISO 8583
PECB
 
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 CardsDarshana Senavirathna
 
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
Nour Elbader
 

Viewers also liked (18)

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
 
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)
 
MSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiselineMSDS Anhidrid ftalne kiseline
MSDS Anhidrid ftalne kiseline
 
12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ12. Знешнепалітычная дзейнасць РБ
12. Знешнепалітычная дзейнасць РБ
 
tirted.excited
tirted.excitedtirted.excited
tirted.excited
 
Yirmed Demeke, ETHIOPIA, May 2015
Yirmed  Demeke, ETHIOPIA, May 2015Yirmed  Demeke, ETHIOPIA, May 2015
Yirmed Demeke, ETHIOPIA, May 2015
 
Actividad 3 patricia sevillanos
Actividad 3 patricia sevillanosActividad 3 patricia sevillanos
Actividad 3 patricia sevillanos
 
Fakultät Wirtschaftswissenschaften
Fakultät WirtschaftswissenschaftenFakultät Wirtschaftswissenschaften
Fakultät Wirtschaftswissenschaften
 
Electronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault AnalysisElectronic Voting Machine and Fault Analysis
Electronic Voting Machine and Fault Analysis
 
Comunicato stampa Assocontact
Comunicato stampa AssocontactComunicato stampa Assocontact
Comunicato stampa Assocontact
 
Layman's Guide to ISO8583
Layman's  Guide to ISO8583Layman's  Guide to ISO8583
Layman's Guide to ISO8583
 
ISO8583 MySQL UDF Manual
ISO8583 MySQL UDF ManualISO8583 MySQL UDF Manual
ISO8583 MySQL UDF Manual
 
Iso8583
Iso8583Iso8583
Iso8583
 
الدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكنيالدفعة الثانية الدعم السكني
الدفعة الثانية الدعم السكني
 
ISO 8583 Financial Message Format
ISO 8583 Financial Message FormatISO 8583 Financial Message Format
ISO 8583 Financial Message Format
 
Exploring Payment Platforms - ISO 20022 and ISO 8583
Exploring Payment Platforms - ISO 20022 and ISO 8583Exploring Payment Platforms - ISO 20022 and ISO 8583
Exploring Payment Platforms - ISO 20022 and ISO 8583
 
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
 
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438النسخة الالكترونية  النهائية  لتعميم الحركة وفتح الرغبات1438
النسخة الالكترونية النهائية لتعميم الحركة وفتح الرغبات1438
 

Similar to Advanced Git Presentation By Swawibe

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
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced gitGerrit Wanderer
 
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
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
 

Similar to Advanced Git Presentation By Swawibe (20)

GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
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
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesGit: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best Practices
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
Git github
Git githubGit github
Git github
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
Gittalk
GittalkGittalk
Gittalk
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
 
Git foundation
Git foundationGit foundation
Git foundation
 
Git Acquainted
Git AcquaintedGit Acquainted
Git Acquainted
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Git commands
Git commandsGit commands
Git commands
 
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
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Git
GitGit
Git
 
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
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 

Recently uploaded

Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

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
  • 4.
  • 5.
  • 6.
  • 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
  • 11.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 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 <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(-)
  • 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 <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!")
  • 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