SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
git



      Handlino   http://handlino.com/
basics



Handlino   http://handlino.com/
git                  ...
•
•
    • Everything is local
    • : commit / tag / tree / blob
•
              Handlino   http://handlino.com/
git clone git://host/project.git
git clone ssh://host/project
git clone /path/to/project


#     project/

#     project/.git/

           Handlino   http://handlino.com/
cd project


git log
git log --graph
git branch -a
git blame src.rb


gitx # http://gitx.frim.nl
gitk # built-in


                   Handlino   http://handlino.com/
Handlino   http://handlino.com/
Handlino   http://handlino.com/
“commit”
                                                sha1 digest

commit 9d38288f99caa27b7368d8a2b26c3b545f0eb37b
Author: tka lu <tka@mail2000.com.tw>
Date:   Wed Dec 23 08:51:59 2009 +0800

   fix label_render in form_interface_helper




              Handlino   http://handlino.com/
more “git log”
git log <from>...<to> # <to> is default to HEAD


git log 22f9d..5d113
git log 22f9d..5d113 --name-only
git log 22f9d..5d113 -u
git log HEAD~10..


git log --pretty=oneline
   --abbrev-commit
   --decorate
   HEAD~10..



                       Handlino   http://handlino.com/
more “git log”
git config alias.lol

   'log --pretty=oneline --abbrev-commit --graph --decorate'



git lol '@{10 days ago}..'

git lol '@{1 week ago}..'
git lol '@{1 week ago}..'

git lol '@{2009-12-20 01:01:01}..'




                       Handlino   http://handlino.com/
vim src1.pl src2.pl


git status #

git diff #



git add src1.pl src2.pl #                               staging area



git diff --cached #         staging area

git commit -m "An *awesome* work" #               staging area



                      Handlino   http://handlino.com/
Staging area



git add                  git commit




    Handlino   http://handlino.com/
git pull #          ←

git push #          !



git pull github master
git push github bug-31337

             Handlino   http://handlino.com/
mkdir NewProject
cd NewProject
git init
echo "New Project" > README
git add README
git ci -m "first commit!"

           Handlino   http://handlino.com/
git reset HEAD^ #

git reset <sha1> #


vim src1.pl


git add src1.pl src2.pl
git commit -m "An *awesome* work"

              Handlino   http://handlino.com/
git log
                              git status
git branch
                              git commit
git checkout
                              git merge
git add
                              git tag
git diff



             Handlino   http://handlino.com/
branch / merge



   Handlino   http://handlino.com/
branch
git branch
git branch -a


git branch <new branch name>
git checkout <branch name>
git checkout -b <new branch name>



                Handlino   http://handlino.com/
merge
git checkout <branch name>
git merge <other branch name>


git checkout job-a
git merge job-b
# job-a <-job-b

           Handlino   http://handlino.com/
What is a “branch” ?


 c866




master


         Handlino   http://handlino.com/
What is a “branch” ?

       git commit

c866       a957




         master


                  Handlino   http://handlino.com/
What is a “branch” ?

              git commit

c866   a957        8ecd




                 master


               Handlino   http://handlino.com/
What is a “branch” ?

                         git commit


c866   a957       8ecd              316f




                                master


              Handlino   http://handlino.com/
What is a “branch” ?
                                           git commit


c866   a957       8ecd              316f         1aee




                                                master



              Handlino   http://handlino.com/
What is a “branch” ?

                                                   git commit

c866   a957       8ecd              316f        1aee     c3f2




                                                       master



              Handlino   http://handlino.com/
What is a “branch” ?


c866       a957




         master

       git commit
                  Handlino   http://handlino.com/
What is a “branch” ?
  bug-37
                     git checkout -b bug 37
                     git commit
           ce33




c866       a957




         master

       git commit
                  Handlino   http://handlino.com/
What is a “branch” ?
             bug-37                                 git commit

       ce33        1aee                     c3f2




c866   a957       8ecd               316f           1aee




                                                   master

                                                           git commit
              Handlino    http://handlino.com/
What is a “branch” ?
       ce33        1aee                     c3f2




c866   a957       8ecd               316f          1aee     1aee




              git merge bug-37                            master


              Handlino    http://handlino.com/
What is a “branch” ?
                                                            “merge”
       ce33        1aee                     c3f2
                                                            commit

c866   a957       8ecd               316f          1aee     1aee




              git merge bug-37                            master


              Handlino    http://handlino.com/
Current branch


c866    a957       8ecd              316f        1aee     c3f2




                                                        master



               Handlino   http://handlino.com/
Current branch

                                                        HEAD


c866    a957       8ecd              316f        1aee     c3f2




                                                        master



               Handlino   http://handlino.com/
Current branch
                                      commit            HEAD


c866    a957       8ecd              316f        1aee     c3f2




                                                        master



               Handlino   http://handlino.com/
Current branch
               bug-37

                                                    HEAD
        ce33        1aee                     c3f2




c866    a957       8ecd               316f           1aee




                                                    master


               Handlino    http://handlino.com/
Current branch
                bug-37


          ce33        1aee                     c3f2




c866      a957       8ecd               316f           1aee
                                           HEAD

       git checkout bug-37
                                                      master


                 Handlino    http://handlino.com/
workflow



Handlino   http://handlino.com/
Topic Branch




  Handlino   http://handlino.com/
Topic Branch
git checkout -b js-refactor


vim foo.js bar.js
git commit -a -m "delete weird codes"


vim foo.js bar.js
git commit -a -m "add good code."


git checkout master
git merge js-refactor


git pull
git push




                        Handlino    http://handlino.com/
branch from master,
 merge to master.
                               css-refactor




                                              master

                bug-3414


     Handlino   http://handlino.com/
Branch

rc - deploy to staging
release - deploy to production
master - dev trunk
(others) - dev topics



            Handlino   http://handlino.com/
topic → master → rc → release
(master) git checkout -b awesome-feature
# hack, hack, hack
git checkout master
git merge awesome-feature


git co rc
git merge master
# deploy. test staging


git co release
git merge rc
# deploy to production



                         Handlino   http://handlino.com/
stable master
(master) git checkout -b awesome-feature
# hack, hack, hack
(master) git checkout -b bug-fix-123
# hack, hack, hack


git checkout test
(test) git merge awesome-feature
(test) git merge bug-fix-123
# run QA tests
(test) git checkout master
(master) git merge test
# deploy master to production



                      Handlino   http://handlino.com/
• git help <command>
• gitready.com
• gitcasts.com


            Handlino   http://handlino.com/

Contenu connexe

Similaire à Git

Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android DeveloperEffective
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
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 2017Codemotion
 
Git Basics - RubyFest 2009
Git Basics - RubyFest 2009Git Basics - RubyFest 2009
Git Basics - RubyFest 2009Ariejan de Vroom
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Bosstmacwilliam
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesJavier Alvarez
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)Carlos Duarte do Nascimento
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remotoRodrigo Branas
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffective
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffectiveUI
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails UndergroundAriejan de Vroom
 
Keep your GIT history clean
Keep your GIT history cleanKeep your GIT history clean
Keep your GIT history cleantomasbro
 

Similaire à Git (20)

Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With 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 - RubyFest 2009
Git Basics - RubyFest 2009Git Basics - RubyFest 2009
Git Basics - RubyFest 2009
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Git社内勉強会
Git社内勉強会Git社内勉強会
Git社内勉強会
 
Loading...git
Loading...gitLoading...git
Loading...git
 
git session --interactive
git session --interactivegit session --interactive
git session --interactive
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
simple Git
simple Git simple Git
simple Git
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Keep your GIT history clean
Keep your GIT history cleanKeep your GIT history clean
Keep your GIT history clean
 

Plus de Kang-min Liu

The architecture of search engines in Booking.com
The architecture of search engines in Booking.comThe architecture of search engines in Booking.com
The architecture of search engines in Booking.comKang-min Liu
 
Elasticsearch 實戰介紹
Elasticsearch 實戰介紹Elasticsearch 實戰介紹
Elasticsearch 實戰介紹Kang-min Liu
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Integration Test With Cucumber And Webrat
Integration Test With Cucumber And WebratIntegration Test With Cucumber And Webrat
Integration Test With Cucumber And WebratKang-min Liu
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In PerlKang-min Liu
 
Javascript Tutorial
Javascript TutorialJavascript Tutorial
Javascript TutorialKang-min Liu
 
Handlino - RandomLife
Handlino - RandomLifeHandlino - RandomLife
Handlino - RandomLifeKang-min Liu
 
網頁程式還可以怎麼設計
網頁程式還可以怎麼設計網頁程式還可以怎麼設計
網頁程式還可以怎麼設計Kang-min Liu
 
OSDC.tw 2008 Lightening Talk
OSDC.tw 2008 Lightening TalkOSDC.tw 2008 Lightening Talk
OSDC.tw 2008 Lightening TalkKang-min Liu
 
Happy Designer 20080329
Happy Designer 20080329Happy Designer 20080329
Happy Designer 20080329Kang-min Liu
 

Plus de Kang-min Liu (14)

o̍h Tai-gi
o̍h Tai-gio̍h Tai-gi
o̍h Tai-gi
 
The architecture of search engines in Booking.com
The architecture of search engines in Booking.comThe architecture of search engines in Booking.com
The architecture of search engines in Booking.com
 
Elasticsearch 實戰介紹
Elasticsearch 實戰介紹Elasticsearch 實戰介紹
Elasticsearch 實戰介紹
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Integration Test With Cucumber And Webrat
Integration Test With Cucumber And WebratIntegration Test With Cucumber And Webrat
Integration Test With Cucumber And Webrat
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
Javascript Tutorial
Javascript TutorialJavascript Tutorial
Javascript Tutorial
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Handlino - RandomLife
Handlino - RandomLifeHandlino - RandomLife
Handlino - RandomLife
 
Jformino
JforminoJformino
Jformino
 
Test Continuous
Test ContinuousTest Continuous
Test Continuous
 
網頁程式還可以怎麼設計
網頁程式還可以怎麼設計網頁程式還可以怎麼設計
網頁程式還可以怎麼設計
 
OSDC.tw 2008 Lightening Talk
OSDC.tw 2008 Lightening TalkOSDC.tw 2008 Lightening Talk
OSDC.tw 2008 Lightening Talk
 
Happy Designer 20080329
Happy Designer 20080329Happy Designer 20080329
Happy Designer 20080329
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Git

  • 1. git Handlino http://handlino.com/
  • 2. basics Handlino http://handlino.com/
  • 3. git ... • • • Everything is local • : commit / tag / tree / blob • Handlino http://handlino.com/
  • 4. git clone git://host/project.git git clone ssh://host/project git clone /path/to/project # project/ # project/.git/ Handlino http://handlino.com/
  • 5. cd project git log git log --graph git branch -a git blame src.rb gitx # http://gitx.frim.nl gitk # built-in Handlino http://handlino.com/
  • 6. Handlino http://handlino.com/
  • 7. Handlino http://handlino.com/
  • 8. “commit” sha1 digest commit 9d38288f99caa27b7368d8a2b26c3b545f0eb37b Author: tka lu <tka@mail2000.com.tw> Date: Wed Dec 23 08:51:59 2009 +0800 fix label_render in form_interface_helper Handlino http://handlino.com/
  • 9. more “git log” git log <from>...<to> # <to> is default to HEAD git log 22f9d..5d113 git log 22f9d..5d113 --name-only git log 22f9d..5d113 -u git log HEAD~10.. git log --pretty=oneline --abbrev-commit --decorate HEAD~10.. Handlino http://handlino.com/
  • 10. more “git log” git config alias.lol 'log --pretty=oneline --abbrev-commit --graph --decorate' git lol '@{10 days ago}..' git lol '@{1 week ago}..' git lol '@{1 week ago}..' git lol '@{2009-12-20 01:01:01}..' Handlino http://handlino.com/
  • 11. vim src1.pl src2.pl git status # git diff # git add src1.pl src2.pl # staging area git diff --cached # staging area git commit -m "An *awesome* work" # staging area Handlino http://handlino.com/
  • 12. Staging area git add git commit Handlino http://handlino.com/
  • 13. git pull # ← git push # ! git pull github master git push github bug-31337 Handlino http://handlino.com/
  • 14. mkdir NewProject cd NewProject git init echo "New Project" > README git add README git ci -m "first commit!" Handlino http://handlino.com/
  • 15. git reset HEAD^ # git reset <sha1> # vim src1.pl git add src1.pl src2.pl git commit -m "An *awesome* work" Handlino http://handlino.com/
  • 16. git log git status git branch git commit git checkout git merge git add git tag git diff Handlino http://handlino.com/
  • 17. branch / merge Handlino http://handlino.com/
  • 18. branch git branch git branch -a git branch <new branch name> git checkout <branch name> git checkout -b <new branch name> Handlino http://handlino.com/
  • 19. merge git checkout <branch name> git merge <other branch name> git checkout job-a git merge job-b # job-a <-job-b Handlino http://handlino.com/
  • 20. What is a “branch” ? c866 master Handlino http://handlino.com/
  • 21. What is a “branch” ? git commit c866 a957 master Handlino http://handlino.com/
  • 22. What is a “branch” ? git commit c866 a957 8ecd master Handlino http://handlino.com/
  • 23. What is a “branch” ? git commit c866 a957 8ecd 316f master Handlino http://handlino.com/
  • 24. What is a “branch” ? git commit c866 a957 8ecd 316f 1aee master Handlino http://handlino.com/
  • 25. What is a “branch” ? git commit c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
  • 26. What is a “branch” ? c866 a957 master git commit Handlino http://handlino.com/
  • 27. What is a “branch” ? bug-37 git checkout -b bug 37 git commit ce33 c866 a957 master git commit Handlino http://handlino.com/
  • 28. What is a “branch” ? bug-37 git commit ce33 1aee c3f2 c866 a957 8ecd 316f 1aee master git commit Handlino http://handlino.com/
  • 29. What is a “branch” ? ce33 1aee c3f2 c866 a957 8ecd 316f 1aee 1aee git merge bug-37 master Handlino http://handlino.com/
  • 30. What is a “branch” ? “merge” ce33 1aee c3f2 commit c866 a957 8ecd 316f 1aee 1aee git merge bug-37 master Handlino http://handlino.com/
  • 31. Current branch c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
  • 32. Current branch HEAD c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
  • 33. Current branch commit HEAD c866 a957 8ecd 316f 1aee c3f2 master Handlino http://handlino.com/
  • 34. Current branch bug-37 HEAD ce33 1aee c3f2 c866 a957 8ecd 316f 1aee master Handlino http://handlino.com/
  • 35. Current branch bug-37 ce33 1aee c3f2 c866 a957 8ecd 316f 1aee HEAD git checkout bug-37 master Handlino http://handlino.com/
  • 36. workflow Handlino http://handlino.com/
  • 37. Topic Branch Handlino http://handlino.com/
  • 38. Topic Branch git checkout -b js-refactor vim foo.js bar.js git commit -a -m "delete weird codes" vim foo.js bar.js git commit -a -m "add good code." git checkout master git merge js-refactor git pull git push Handlino http://handlino.com/
  • 39. branch from master, merge to master. css-refactor master bug-3414 Handlino http://handlino.com/
  • 40. Branch rc - deploy to staging release - deploy to production master - dev trunk (others) - dev topics Handlino http://handlino.com/
  • 41. topic → master → rc → release (master) git checkout -b awesome-feature # hack, hack, hack git checkout master git merge awesome-feature git co rc git merge master # deploy. test staging git co release git merge rc # deploy to production Handlino http://handlino.com/
  • 42. stable master (master) git checkout -b awesome-feature # hack, hack, hack (master) git checkout -b bug-fix-123 # hack, hack, hack git checkout test (test) git merge awesome-feature (test) git merge bug-fix-123 # run QA tests (test) git checkout master (master) git merge test # deploy master to production Handlino http://handlino.com/
  • 43. • git help <command> • gitready.com • gitcasts.com Handlino http://handlino.com/