SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
GIT Version Control
 davidx <mykingheaven@gmail.com>
about branch

A branch in Git is simply a lightweight
movable pointer to one of these commits.

“master” is the default branch
commands
git branch

git checkout

git reset

git merge

git rebase
git branch
git branch - list all branches locally

git branch -r - list all branches on the
remote side

git branch -d <XXX> - delete branch XXX

git branch -m <XXX> <YYY> - rename XXX to
YYY
git checkout

git checkout <BRANCH NAME> - switch to
that branch

git checkout -b <BRANCH NAME> - create a
new branch and switch to that branch
git reset
git reset --hard HEAD - give up all
uncommited changes

git reset --hard HEAD^ - back to the last
commit

ATTENTION: these changes are permanent,
you can not restore. Be careful.
git merge


git merge <BRANCH NAME> - merge changes
to the current branch
git rebase



git rebase <BRANCH NAME> - get changes
since master is changed
before rebase

          A -> B -> C -- branch
      /
D -> E -> F -- master
after rebase

               A -> B -> C -- branch
           /
D -> E -> F -- master
how we work

master branch is the root branch, you should
not develop under this branch

all feature development should under their
own branches

only when a feature is finished can it be
merged into develop branch

bug fix should have its own branch
example
initiate a repository

create a new branch: develop

create a new feature branch:feature1

merge feature1 into develop

create a new feature branch:feature2

merge feature2 into develop

merge develop into master and create a tag for it
when you fix a bug

create a new branch from develop: 512

fix your bug

switch to develop

merge branch 512

delete branch 512 - this step is optional
work with svn
I don’t use any plugins for it

always update svn in master branch

always commit svn in master branch

develop or fix bug in new git branch

merge into master branch

rebase other branches if master get updates
git flow


it’s a very successful git branch model

it have 2 important branches: master, develop

develop is the hot branch, all tests can be
done under this branch
feature
                                                    release branches
                       branches           develop                                hot xes   master




                                                                                                    Tag




Time
                                                                                                    0.1



                           Major                                   Severe bug
                         feature for                                  xed for
        Feature                                                    production:
                        next release
       for future                                                   hot x 0.2
        release

                                                    Incorporate
                                                      bug x in
                                                      develop


                                                                                                    Tag
                                                                                                    0.2



                                                                          Start of
                                                                          release
                                                                         branch for

                    From this point on,
                                                                            1.0
                       “next release”
                    means the release
                         after 1.0


                                                                           Only
                                                                         bug xes!




                                                    Bug xes from
                                                                                                    Tag
                                                     rel. branch
                                                       may be                                       1.0
                                                    continuously
                                                    merged back
                                                    into develop
Q&A

Weitere ähnliche Inhalte

Ähnlich wie Git version control

A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
abodeltae
 
Revisions
RevisionsRevisions
Revisions
swat_kh
 

Ähnlich wie Git version control (20)

Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Uber git workflow
Uber git workflowUber git workflow
Uber git workflow
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
 
Source code management with Git
Source code management with GitSource code management with Git
Source code management with Git
 
Git flow workflow example
Git flow workflow exampleGit flow workflow example
Git flow workflow example
 
Subversion
SubversionSubversion
Subversion
 
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
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Hdfs high availability
Hdfs high availabilityHdfs high availability
Hdfs high availability
 
Clarive 7 Branching Model
Clarive 7 Branching ModelClarive 7 Branching Model
Clarive 7 Branching Model
 
Revisions
RevisionsRevisions
Revisions
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Git version control

  • 1. GIT Version Control davidx <mykingheaven@gmail.com>
  • 2. about branch A branch in Git is simply a lightweight movable pointer to one of these commits. “master” is the default branch
  • 3. commands git branch git checkout git reset git merge git rebase
  • 4. git branch git branch - list all branches locally git branch -r - list all branches on the remote side git branch -d <XXX> - delete branch XXX git branch -m <XXX> <YYY> - rename XXX to YYY
  • 5. git checkout git checkout <BRANCH NAME> - switch to that branch git checkout -b <BRANCH NAME> - create a new branch and switch to that branch
  • 6. git reset git reset --hard HEAD - give up all uncommited changes git reset --hard HEAD^ - back to the last commit ATTENTION: these changes are permanent, you can not restore. Be careful.
  • 7. git merge git merge <BRANCH NAME> - merge changes to the current branch
  • 8. git rebase git rebase <BRANCH NAME> - get changes since master is changed
  • 9. before rebase A -> B -> C -- branch / D -> E -> F -- master
  • 10. after rebase A -> B -> C -- branch / D -> E -> F -- master
  • 11. how we work master branch is the root branch, you should not develop under this branch all feature development should under their own branches only when a feature is finished can it be merged into develop branch bug fix should have its own branch
  • 12. example initiate a repository create a new branch: develop create a new feature branch:feature1 merge feature1 into develop create a new feature branch:feature2 merge feature2 into develop merge develop into master and create a tag for it
  • 13. when you fix a bug create a new branch from develop: 512 fix your bug switch to develop merge branch 512 delete branch 512 - this step is optional
  • 14. work with svn I don’t use any plugins for it always update svn in master branch always commit svn in master branch develop or fix bug in new git branch merge into master branch rebase other branches if master get updates
  • 15. git flow it’s a very successful git branch model it have 2 important branches: master, develop develop is the hot branch, all tests can be done under this branch
  • 16. feature release branches branches develop hot xes master Tag Time 0.1 Major Severe bug feature for xed for Feature production: next release for future hot x 0.2 release Incorporate bug x in develop Tag 0.2 Start of release branch for From this point on, 1.0 “next release” means the release after 1.0 Only bug xes! Bug xes from Tag rel. branch may be 1.0 continuously merged back into develop
  • 17. Q&A