SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Git

 Distributed Version Control System




                                 by Viktor Pyskunov
About
• Created by Linus Torvalds, author of Linux
• Very fast
• Used in Linux kernel development
• Makes working with branches really fun
• Better conflict resolution
• Working offline
• There are no hundreds of .svn directories all over the
  code, instead only one .git directory in the root of project
• Comfortable to work with commits
Git design objectives
• Distributed
  • No central repo
  • Everyone is on her own island
• Performance
  • Branching and merge is cheap
  • Diff the whole kernel tree in less than 1 second
  • Store the KDE tree in less than 2GB while SVN takes
    8GB
SVN Way




• Commit concurrency
• Slow history
• Unstaged changes that may be lost due to conflicts
Git Way




•   Every developer has their own repo
•   Fast history as well as commits
•   A lot of local commits before pushing
•   Code staging decreases possibility of data loss
Git Entities




•   Working directory
•   Index, or staging
•   Local repository
•   Remote repository
Git Commands Dealing with Entities
Generate ssh Key
Click on Start->Programs->TortoiseGit->PuttyGen
Generate
Save private key




                                    Console:
                                    ssh-keygen
Generate ssh Key
Don’t close the window
Save this key somewhere
Start->Programs->
TortoiseGit->Pageant
Typical Git Workflow
•   Pull from remote repository
•   Edit files
•   Add
•   Commit
•   Edit files again together with new ones
•   Add
•   Commit
•   Push to remote repository
Typical Git Workflow Visualized
Extended Git Workflow
•   Pull from remote repository
•   Create new branch from common branch
•   Edit files
•   Add
•   Commit
•   Edit files again together with new ones
•   Add
•   Commit
•   Merge your working branch to common branch
•   Resolve conflicts
•   Delete working branch
•   Push to remote repository
Tortoise Git
Cloning Repository




                     Console:
                     git clone <path_to_repository>
Initial Repository
History




          Console:
          git log
Adding new file




                  Console:
                  git add <file1> <file2> …
Committing Changes




                     Console:
                     git commit <file1> <file2> …
History with New Commit
New Branch with the Third File




                    Console:
                    git branch <name_of_branch>
Adding File
Committing File in Branch
Switching to Master




                      Console:
                      git checkout <name_of_branch>
Merge from Branch to Master




                   Console:
                   git merge <name_of_branch>
Master After Merge
Branches After Merge
Push Your Modifications




            Checkbox will push all your branches
            If unchecked, only selected branches will be pushed

                              Console:
                              git push <repository> <branch>
Fetch with rebase




             Using fetch with rebase instead of pull will flatten
             history of commits to make it sequential
                             Console:
                             git pull --rebase
Reverting Commit




                   Console:
                   git revert <hash_of_commit>
References
• Book http://progit.org/book/
• Tools http://guides.beanstalkapp.com/version-
  control/clients.html

Mais conteúdo relacionado

Mais procurados (20)

Git 101
Git 101Git 101
Git 101
 
Git
GitGit
Git
 
Git ritesh venture_pact
Git ritesh venture_pactGit ritesh venture_pact
Git ritesh venture_pact
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
 
Git tutorial II
Git tutorial IIGit tutorial II
Git tutorial II
 
Git basic
Git basicGit basic
Git basic
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git basics
Git basicsGit basics
Git basics
 
An Introduction to Git
An Introduction to GitAn Introduction to Git
An Introduction to Git
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Git theory
Git   theoryGit   theory
Git theory
 
Git basics
Git basicsGit basics
Git basics
 

Destaque

Language processor implementation using python
Language processor implementation using pythonLanguage processor implementation using python
Language processor implementation using pythonViktor Pyskunov
 
Moderní technologie v kancelářích Ernst & Young
Moderní technologie v kancelářích Ernst & YoungModerní technologie v kancelářích Ernst & Young
Moderní technologie v kancelářích Ernst & YoungAV MEDIA, a.s.
 
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)Filipe MS Bento
 
Příběh AV MEDIA, a.s.- INFOGRAFIE
Příběh AV MEDIA, a.s.- INFOGRAFIEPříběh AV MEDIA, a.s.- INFOGRAFIE
Příběh AV MEDIA, a.s.- INFOGRAFIEAV MEDIA, a.s.
 
Infografie videokonference
Infografie videokonferenceInfografie videokonference
Infografie videokonferenceAV MEDIA, a.s.
 
Interní komunikace - Info TV
Interní komunikace - Info TVInterní komunikace - Info TV
Interní komunikace - Info TVAV MEDIA, a.s.
 
Lecture 6 inflammation.pptx
Lecture 6 inflammation.pptxLecture 6 inflammation.pptx
Lecture 6 inflammation.pptxKizito Robert
 
Tata Crucible bhubaneswar prelims
Tata Crucible bhubaneswar prelimsTata Crucible bhubaneswar prelims
Tata Crucible bhubaneswar prelimstatacrucible
 
git - eine praktische Einführung
git - eine praktische Einführunggit - eine praktische Einführung
git - eine praktische EinführungMarcel Eichner
 
Einsatz von Git im Unternehmen
Einsatz von Git im UnternehmenEinsatz von Git im Unternehmen
Einsatz von Git im Unternehmenoose
 
Sei (k)ein Blödmann und nimm Git!
Sei (k)ein Blödmann und nimm Git!Sei (k)ein Blödmann und nimm Git!
Sei (k)ein Blödmann und nimm Git!Stefan Imhoff
 

Destaque (20)

Jednoduchá obsluha
Jednoduchá obsluhaJednoduchá obsluha
Jednoduchá obsluha
 
Language processor implementation using python
Language processor implementation using pythonLanguage processor implementation using python
Language processor implementation using python
 
Moderní technologie v kancelářích Ernst & Young
Moderní technologie v kancelářích Ernst & YoungModerní technologie v kancelářích Ernst & Young
Moderní technologie v kancelářích Ernst & Young
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Komunikace na dalku
Komunikace na dalkuKomunikace na dalku
Komunikace na dalku
 
Spolupráce na dálku
Spolupráce na dálkuSpolupráce na dálku
Spolupráce na dálku
 
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)20140924   3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
20140924 3 Deutsches VuFind-Anwendertreffen _ filipe bento EBSCO (English)
 
Příběh AV MEDIA, a.s.- INFOGRAFIE
Příběh AV MEDIA, a.s.- INFOGRAFIEPříběh AV MEDIA, a.s.- INFOGRAFIE
Příběh AV MEDIA, a.s.- INFOGRAFIE
 
藥局課
藥局課藥局課
藥局課
 
Infografie videokonference
Infografie videokonferenceInfografie videokonference
Infografie videokonference
 
Interní komunikace - Info TV
Interní komunikace - Info TVInterní komunikace - Info TV
Interní komunikace - Info TV
 
Interaktivni porady
Interaktivni poradyInteraktivni porady
Interaktivni porady
 
Cucumber testing
Cucumber testingCucumber testing
Cucumber testing
 
Lecture 6 inflammation.pptx
Lecture 6 inflammation.pptxLecture 6 inflammation.pptx
Lecture 6 inflammation.pptx
 
Tata Crucible bhubaneswar prelims
Tata Crucible bhubaneswar prelimsTata Crucible bhubaneswar prelims
Tata Crucible bhubaneswar prelims
 
Einstieg in git
Einstieg in gitEinstieg in git
Einstieg in git
 
Git Grundlagen
Git GrundlagenGit Grundlagen
Git Grundlagen
 
git - eine praktische Einführung
git - eine praktische Einführunggit - eine praktische Einführung
git - eine praktische Einführung
 
Einsatz von Git im Unternehmen
Einsatz von Git im UnternehmenEinsatz von Git im Unternehmen
Einsatz von Git im Unternehmen
 
Sei (k)ein Blödmann und nimm Git!
Sei (k)ein Blödmann und nimm Git!Sei (k)ein Blödmann und nimm Git!
Sei (k)ein Blödmann und nimm Git!
 

Semelhante a Git presentation, Viktor Pyskunov

Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
11 git version control
11 git version control11 git version control
11 git version controlWasim Alatrash
 
Git for developers
Git for developersGit for developers
Git for developersHacen Dadda
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsChris Bohatka
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial IJim Yeh
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 

Semelhante a Git presentation, Viktor Pyskunov (20)

Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
Learning git
Learning gitLearning git
Learning git
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git training v10
Git training v10Git training v10
Git training v10
 
11 git version control
11 git version control11 git version control
11 git version control
 
Git for developers
Git for developersGit for developers
Git for developers
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Git
GitGit
Git
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 

Git presentation, Viktor Pyskunov