SlideShare a Scribd company logo
Lets talk about GIT
              Stupid, fast, distributed content tracker


                                             Roni Saha
                                      Sr. Software Engineer
Rightbrain Solution Limited & Emicrograph Business Solution
Git uses a distributed model
     Centralized Model        Distributed Model




(CVS, Subversion, Perforce)



                                      (Git, Mercurial)
                              Result: Many operations are local
Git local file lifecycle


untracked         unmodified              modified               staged




                          edit the file
      add the file
                                                stage the file

        remove the file
                                           commit
Overview of Git Workflow/Commands
Git commands
                 command                                     description
git clone url [dir]                          copy a git repository so you can add to it
git add files                                adds file contents to the staging area
git commit                                   records a snapshot of the staging area
git status                                   view the status of your files in the
                                             working directory and staging area
git diff                                     shows diff of what is staged and what is
                                             modified but un-staged
git pull                                     fetch from a remote repo and try to
                                             merge into the current branch
git push                                     push your new branches and data to a
                                             remote repository


                  others: init, reset, branch, checkout, merge, log, tag
Typical Development Workflow
                        Get the code

 git clone some-repo                        git pull

                        Modify Code

       Cerate                             Delete/Edit

                       Save the changes

       git add                      git commit -m "message"

                       Sync with remote

       git pull                             git push
Branch VS Tag


Branch                         Tags
• A branch is just a line of   • Milestone in the life of
  development                    project
• “Branch head” mean a         • Read Only, i.e. reference
  reference to the most          to a fixed commit id
  recent commit on a branch
Merge, The Blessing!!

Some merge Strategies

Resolve       This can only resolve two heads

Recursive     Default strategy when pulling or merging one branch

Octopus       More than two branches

Ours/Theirs   Just mark as merged

No-commit     Do not create a new commit automatically
Conflict, The Devil!!
Resolve Conflict

                               Resolve
• Decide not to                actions!
  merge
                      • $ git merge --abort
• Resolve the
                      • Edit the files into
  conflicts
                        shape then commit

         Conflict
Client is always right!!

Git allows you to use git locally and use SVN as a remote repository


   Create Git clone of Subversion repo
    • $ git svn clone -s svn://example.com/repo

   Update from SVN
    • $ git svn rebase

   Commit to SVN
    • $ git svn dcommit
Case Studies
Merge Commands

 Merge branches fixes and enhancement to the current branch, making an octopus merge:
 $ git merge fixes enhancements

 Merge branch obsolete into the current branch, using ours merge strategy:
 $ git merge -s ours obsolete

 Merge branch partial into the current branch, but do not make a new commit automatically:
 $ git merge --no-commit partial

 Cancel a merge:
 $ git merge --abort
Cancel/Fix a commit
 From latest to some point
 $ git reset –<hard/soft> <where>
 …..
 Edit
 …….
 $ git add ....
 $ git commit -c ORIG_HEAD

 Some commit in the past
 $ git revert <commit>

 Fix latest commit
 $ git commit --amend
Partial commit

 You made several unrelated changes to the same file
 $ git add -p
 <Opens up an interactive session>
 <Choose which hunk of each patch to add to the index>
Pulling into a dirty tree




  • git stash save, git pull, git stash pop
Suspend work for a fix




• git stash save, do the fix, commit, git stash pop
Moving work to a branch
Moving work to a branch

    Switch to (Create) the “v1.12"
    branch
    • git checkout v1.12[git merge master]
    • Or git checkout -b v1.12

    Forcibly move master back to
    early stage
    • git branch -f master HEAD^^^
Any More… Case Studies/Question?
Thank You

More Related Content

What's hot

What is TLS/SSL?
What is TLS/SSL? What is TLS/SSL?
What is TLS/SSL?
Shehzad Imran
 
GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
Weaveworks
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
Tirthika Bandi
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
Bo-Yi Wu
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
shanmuga rajan
 
SSL intro
SSL introSSL intro
SSL intro
Three Lee
 
Cloudian dynamic consistency
Cloudian dynamic consistencyCloudian dynamic consistency
Cloudian dynamic consistency
CLOUDIAN KK
 
Multichannel User Interfaces
Multichannel User InterfacesMultichannel User Interfaces
Multichannel User Interfaces
Icinetic
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
Otto Kekäläinen
 
Transport layer security (tls)
Transport layer security (tls)Transport layer security (tls)
Transport layer security (tls)
Kalpesh Kalekar
 
Introduction to Web Services
Introduction to Web ServicesIntroduction to Web Services
Introduction to Web Services
Thanachart Numnonda
 
Different Types of Security In Records Management
Different Types of Security In Records ManagementDifferent Types of Security In Records Management
Different Types of Security In Records Management
Record Nations
 
E-mail Security in Network Security NS5
E-mail Security in Network Security NS5E-mail Security in Network Security NS5
E-mail Security in Network Security NS5koolkampus
 
Dell Password Manager Introduction
Dell Password Manager IntroductionDell Password Manager Introduction
Dell Password Manager Introduction
Aidy Tificate
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
Callon Campbell
 
SSL TLS Protocol
SSL TLS ProtocolSSL TLS Protocol
SSL TLS Protocol
Devang Badrakiya
 
Image steganography and cryptography
Image steganography and cryptographyImage steganography and cryptography
Image steganography and cryptography
Avinash Mishra
 
Web application framework
Web application frameworkWeb application framework
Web application framework
Pankaj Chand
 

What's hot (20)

What is TLS/SSL?
What is TLS/SSL? What is TLS/SSL?
What is TLS/SSL?
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
A painless self-hosted Git service: Gitea
A painless self-hosted Git service: GiteaA painless self-hosted Git service: Gitea
A painless self-hosted Git service: Gitea
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
3 analysis and design overview
3 analysis and design overview3 analysis and design overview
3 analysis and design overview
 
SSL intro
SSL introSSL intro
SSL intro
 
Cloudian dynamic consistency
Cloudian dynamic consistencyCloudian dynamic consistency
Cloudian dynamic consistency
 
Multichannel User Interfaces
Multichannel User InterfacesMultichannel User Interfaces
Multichannel User Interfaces
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Transport layer security (tls)
Transport layer security (tls)Transport layer security (tls)
Transport layer security (tls)
 
Introduction to Web Services
Introduction to Web ServicesIntroduction to Web Services
Introduction to Web Services
 
Different Types of Security In Records Management
Different Types of Security In Records ManagementDifferent Types of Security In Records Management
Different Types of Security In Records Management
 
E-mail Security in Network Security NS5
E-mail Security in Network Security NS5E-mail Security in Network Security NS5
E-mail Security in Network Security NS5
 
Dell Password Manager Introduction
Dell Password Manager IntroductionDell Password Manager Introduction
Dell Password Manager Introduction
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
 
SSL TLS Protocol
SSL TLS ProtocolSSL TLS Protocol
SSL TLS Protocol
 
Image steganography and cryptography
Image steganography and cryptographyImage steganography and cryptography
Image steganography and cryptography
 
Web application framework
Web application frameworkWeb application framework
Web application framework
 

Viewers also liked

Tcvn 7505 2005 vach kinh
Tcvn 7505 2005 vach kinhTcvn 7505 2005 vach kinh
Tcvn 7505 2005 vach kinh
ngoctung5687
 
Wirelessnetworks mohit mehra
Wirelessnetworks mohit mehraWirelessnetworks mohit mehra
Wirelessnetworks mohit mehraMohit Mehra
 
Tcxd 195 97 nha cao tang -tke coc khn
Tcxd 195  97 nha cao tang -tke coc khnTcxd 195  97 nha cao tang -tke coc khn
Tcxd 195 97 nha cao tang -tke coc khn
ngoctung5687
 
Tcvn 7571 2006 thép hình
Tcvn 7571 2006 thép hìnhTcvn 7571 2006 thép hình
Tcvn 7571 2006 thép hình
ngoctung5687
 
Масленица в детском саду
Масленица в детском садуМасленица в детском саду
Масленица в детском саду
sch426media
 
Праздник 8 марта
Праздник 8 мартаПраздник 8 марта
Праздник 8 марта
sch426media
 
Session1 strategic planning presentation1
Session1 strategic planning presentation1Session1 strategic planning presentation1
Session1 strategic planning presentation1
Sheena Baker
 
Working with and around our equipment1
Working with and around our equipment1Working with and around our equipment1
Working with and around our equipment1
Sheena Baker
 

Viewers also liked (9)

Tcvn 7505 2005 vach kinh
Tcvn 7505 2005 vach kinhTcvn 7505 2005 vach kinh
Tcvn 7505 2005 vach kinh
 
Wirelessnetworks mohit mehra
Wirelessnetworks mohit mehraWirelessnetworks mohit mehra
Wirelessnetworks mohit mehra
 
Tcxd 195 97 nha cao tang -tke coc khn
Tcxd 195  97 nha cao tang -tke coc khnTcxd 195  97 nha cao tang -tke coc khn
Tcxd 195 97 nha cao tang -tke coc khn
 
Curriculum vitae
Curriculum vitaeCurriculum vitae
Curriculum vitae
 
Tcvn 7571 2006 thép hình
Tcvn 7571 2006 thép hìnhTcvn 7571 2006 thép hình
Tcvn 7571 2006 thép hình
 
Масленица в детском саду
Масленица в детском садуМасленица в детском саду
Масленица в детском саду
 
Праздник 8 марта
Праздник 8 мартаПраздник 8 марта
Праздник 8 марта
 
Session1 strategic planning presentation1
Session1 strategic planning presentation1Session1 strategic planning presentation1
Session1 strategic planning presentation1
 
Working with and around our equipment1
Working with and around our equipment1Working with and around our equipment1
Working with and around our equipment1
 

Similar to Session git

Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Chen-Han Hsiao
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Getting started with GIT
Getting started with GITGetting started with GIT
Getting started with GIT
pratz0909
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Lukas Fittl
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git
GitGit
Source control management
Source control managementSource control management
Source control management
Owen Winkler
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
Shinho Kang
 
Git slides
Git slidesGit slides
Git slides
Nanyak S
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
Serhii Kartashov
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
 
Working with Git
Working with GitWorking with Git
Working with Git
Sanghoon Hong
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
Arashdeepkaur16
 
Git
GitGit

Similar to Session git (20)

Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15Git basic stanley hsiao 2010_12_15
Git basic stanley hsiao 2010_12_15
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git basic
Git basicGit basic
Git basic
 
Getting started with GIT
Getting started with GITGetting started with GIT
Getting started with GIT
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Source control management
Source control managementSource control management
Source control management
 
Git
GitGit
Git
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Git slides
Git slidesGit slides
Git slides
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Git
GitGit
Git
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
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
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
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
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
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
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
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
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
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
 

Session git

  • 1. Lets talk about GIT Stupid, fast, distributed content tracker Roni Saha Sr. Software Engineer Rightbrain Solution Limited & Emicrograph Business Solution
  • 2. Git uses a distributed model Centralized Model Distributed Model (CVS, Subversion, Perforce) (Git, Mercurial) Result: Many operations are local
  • 3. Git local file lifecycle untracked unmodified modified staged edit the file add the file stage the file remove the file commit
  • 4. Overview of Git Workflow/Commands
  • 5. Git commands command description git clone url [dir] copy a git repository so you can add to it git add files adds file contents to the staging area git commit records a snapshot of the staging area git status view the status of your files in the working directory and staging area git diff shows diff of what is staged and what is modified but un-staged git pull fetch from a remote repo and try to merge into the current branch git push push your new branches and data to a remote repository others: init, reset, branch, checkout, merge, log, tag
  • 6. Typical Development Workflow Get the code git clone some-repo git pull Modify Code Cerate Delete/Edit Save the changes git add git commit -m "message" Sync with remote git pull git push
  • 7. Branch VS Tag Branch Tags • A branch is just a line of • Milestone in the life of development project • “Branch head” mean a • Read Only, i.e. reference reference to the most to a fixed commit id recent commit on a branch
  • 8. Merge, The Blessing!! Some merge Strategies Resolve This can only resolve two heads Recursive Default strategy when pulling or merging one branch Octopus More than two branches Ours/Theirs Just mark as merged No-commit Do not create a new commit automatically
  • 10. Resolve Conflict Resolve • Decide not to actions! merge • $ git merge --abort • Resolve the • Edit the files into conflicts shape then commit Conflict
  • 11. Client is always right!! Git allows you to use git locally and use SVN as a remote repository Create Git clone of Subversion repo • $ git svn clone -s svn://example.com/repo Update from SVN • $ git svn rebase Commit to SVN • $ git svn dcommit
  • 13. Merge Commands  Merge branches fixes and enhancement to the current branch, making an octopus merge: $ git merge fixes enhancements  Merge branch obsolete into the current branch, using ours merge strategy: $ git merge -s ours obsolete  Merge branch partial into the current branch, but do not make a new commit automatically: $ git merge --no-commit partial  Cancel a merge: $ git merge --abort
  • 14. Cancel/Fix a commit  From latest to some point $ git reset –<hard/soft> <where> ….. Edit ……. $ git add .... $ git commit -c ORIG_HEAD  Some commit in the past $ git revert <commit>  Fix latest commit $ git commit --amend
  • 15. Partial commit  You made several unrelated changes to the same file $ git add -p <Opens up an interactive session> <Choose which hunk of each patch to add to the index>
  • 16. Pulling into a dirty tree • git stash save, git pull, git stash pop
  • 17. Suspend work for a fix • git stash save, do the fix, commit, git stash pop
  • 18. Moving work to a branch
  • 19. Moving work to a branch Switch to (Create) the “v1.12" branch • git checkout v1.12[git merge master] • Or git checkout -b v1.12 Forcibly move master back to early stage • git branch -f master HEAD^^^
  • 20. Any More… Case Studies/Question?