SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
GIT-Workshop



Using GIT (distributed version
     control) for TYPO3-
        Development
           TYPO3 Developer Days 2010
                       Elmshorn
                    Peter Niederlag




 T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Agenda

Introduction
  Version Control
  GIT vs. svn
  Installation
Create a repository
Basic wording and concepts
File exclusion (.gitignore)
Branching
Merging
Resolving Conflicts
Collaboration, going remote
Stashing
Rebasing
SVN interoperability
Links


               T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Version Control

Teamwork in running project
  What was changed by whom, why and when?
Version Control System (VCS)
  cvs (Concurrent version System), svn (subversion)
  Central, non distributed, one history, no easy local
  commit or history possible
Distributed Version Control System (DVCS)
  Multiple, non-central repositories with their own full
  history
  Easy colaboration between repositories
  git, bazaar, mercurial, darcs, ....

         T3DD10 Elmshorn, Peter Niederlag, niekom netservice
GIT vs. svn

Pro
 Distributed
 Leightweight branches
 Efficiency (fast history, disk space)
 rebasing
Con
 Something new to learn
 Improper usage(rebasing/reset) can cause
 trouble

      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Installation

Distro packages:
  Debian based: git-core(git), gitk, (gitweb)
  Fedora: git, gitk, (git-email), (gitweb), git-all
  (git-arch git-cvs git-email git-gui gitk git-svn
  perl-Git)
  OpenSuse: git/git-core
  Gentoo: dev-util/git (includes gitk and gitweb)
  Windows: http://code.google.com/p/msysgit/
git --help

       T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Most Important Commands

git init                                     git config
git add                                      git clone
git commit                                   git remote
git log                                      git fetch
git branch                                   git pull
git checkout                                 git push
git status                                   git merge
git reset                                    git rebase
git tag                                      git diff
git mv                                       git blame
git rm                                       gitk

          T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Configure git

Setup e-mail and name
   $$ git config --global user.name "Your Name Comes Here"
     git config --global user.name "Your Name Comes Here"
   $$ git config --global user.email you@yourdomain.example.com
     git config --global user.email you@yourdomain.example.com



Color it up
   $$ git config --global color.ui auto
     git config --global color.ui auto
   $$ # git config --global color.diff auto
     # git config --global color.diff auto
   $$ # git config --global color.status auto
     # git config --global color.status auto
   $$ # git config --global color.branch auto
     # git config --global color.branch auto
   $$ git config --global pager.status yes
     git config --global pager.status yes




         T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Create a repository

                                      $$ mkdir myproject
                                        mkdir myproject
Create a repository                   $$ cd myproject
                                        cd myproject
(very fast)                           $$ git init
                                        git init
                                      $$ ## ... hack on files
                                            ... hack on files
                                      $$ git add .
                                        git add .
Add files                             $$ git commit
                                        git commit
                                      $$ git log
                                        git log
Commit
Check the log




      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Basic wording and concepts

Repository
  holds all versioning information and data (.git or GIT_DIR)
Working tree
  is where the working files are, a „bare“ repository does not
  have a working tree
The Index
  the glue between the working tree and the repository,
  sometimes also referred to as the „staging area“.
  Changes that are to be performed with next commit




          T3DD10 Elmshorn, Peter Niederlag, niekom netservice
SHA-1 Hashes

Git doesn't have numeric version id's like subversion
or bazaar
Each object (commit, tree, blob, tag) has a unique
SHA-1, which is calulated from the content by git
SHA-1 can be abbreviated (at least four signs)
References are used for more meaningful names for
any SHA-1 of a commit
  Tags: refs/tags
  Branches: refs/heads
  Remotes: refs/remotes


        T3DD10 Elmshorn, Peter Niederlag, niekom netservice
More Work

                                     $$ git status
                                       git status
Doing some more                      $$ # hack, hack
                                       # hack, hack
work on the                          $$ git status
                                       git status
                                     $$ git add
                                       git add
working tree                         $$ git status
                                       git status
                                     $$ git commit -m 'my commit message'
                                       git commit -m 'my commit message'
                                     $$ git log
                                       git log
                                     $$ git status
                                       git status




     T3DD10 Elmshorn, Peter Niederlag, niekom netservice
File exclusion (.gitignore)

Ignoring/Excluding files
  .git/info/exclude (repository)
  .gitignore (working tree, anywhere)
Reversing Exclusion
  Can be done by „!“ prefix
  !index.html




       T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Branching

                                      ## create branch
                                        create branch
Create a Branch                       $$ git branch myfeature
                                        git branch myfeature
                                      ## checkout branch
                                        checkout branch
Checkout a Branch                     $$ git checkout myfeature
                                        git checkout myfeature
                                      ## shortcut, create and checkout
                                        shortcut, create and checkout
List Branches                         $$ git checkout -b myfeature
                                          git checkout -b myfeature

Delete Branch                         ## list available branches
                                        list available branches
                                      $$ git branch -av
                                        git branch -av
Rename a Branch                       ## delete branch
                                        delete branch
                                      $$ git branch -d obsoletebranch
                                        git branch -d obsoletebranch

                                      ## rename a branch
                                        rename a branch
                                      $$ git branch -m oldname newname
                                        git branch -m oldname newname




      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
.git/config

.git/config
  Holds configuration for the repository
  Setup of branches and remotes
  Default setup for merging of branches




       T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Work on any branch

                                      $$ git branch
                                        git branch
Doing some more                       $$ git checkout whatever
                                        git checkout whatever
work on any                           $$ # hack, hack
                                        # hack, hack
                                      $$ git status
                                        git status
branch (git branch,                   $$ git add
                                        git add
                                      $$ git status
                                        git status
git checkout, git                     $$ git commit -m 'my commit message'
                                        git commit -m 'my commit message'
                                      $$ git log
                                        git log
commit)                               $$ git status
                                        git status
                                      $$ git branch
                                        git branch
                                      $$ git checkout whatever
                                        git checkout whatever




      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Merging

                                    ## merge another branch
                                      merge another branch
Merging                             $$ git merge otherbranch
                                      git merge otherbranch

Fast Forward                        ## merge, withoud committing
                                      merge, withoud committing
                                    $$ git merge –no-commit otherbranch
                                      git merge –no-commit otherbranch
  fast-forward is a
  special case of a                 ## merge, but combine all commits into one
                                      merge, but combine all commits into one
                                    $$ git merge –squash otherbranch
                                      git merge –squash otherbranch
  merge, where only
  the other branch
  has additional
  commits and our
  branch can just be
  „moved forward“

       T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Resolving Conflicts

Conflict     ## merge another branch
                merge another branch
             $$ git merge otherbranch
                git merge otherbranch
when         ... CONFLICT (content): Merge conflict in foobar
               ... CONFLICT (content): Merge conflict in foobar
             Automatic merge failed; fix conflicts and then commit the result
               Automatic merge failed; fix conflicts and then commit the result
merging
             $$ git status
                 git status
             ...
               ...
             ## both modified: foobar
                 both modified: foobar
             .....
               .....
             $$ git diff; git diff –ours; git diff –theirs
               git diff; git diff –ours; git diff –theirs

             ## resolve
               resolve
             $$ „edit file to solve the conflict“
               „edit file to solve the conflict“
             $$ git add foobar
               git add foobar
             $$ git commit
               git commit
             ## alternativ:
               alternativ:
             $$ git mergetool
               git mergetool

      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Collaboration, going remote

remotes                             ## remotes
                                      remotes
                                    $$ git remote
                                      git remote
Adding other                        $$ git remote add myname URL
                                      git remote add myname URL
repositories for cowork             $$ cat .git/config
                                      cat .git/config
By default remote is                $$ git remote add pn
                                      git remote add pn
called „origin“                     http://h01.niekom.de/sandbox.git
                                     http://h01.niekom.de/sandbox.git
git clone is shortcut
  Create rep
  Add remote
  Add local branch that
  tracks remote branch




           T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Remotes: fetch, pull, push

git fetch
  Fetches any remote commits
git pull
  Fetches any remote commits and merges
  them, boils down to git fetch plus git merge
git push
  Pushes any „new“ local commits to the
  Remote


           T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Change latest commit

                                   ## change the most recent commit
                                     change the most recent commit
ATTENTION                          $$ git commit --amend
                                     git commit --amend
only use if the                    ## hack, add, remove files to the index
                                     hack, add, remove files to the index
commit was not                     ## change the most recent commit
                                     change the most recent commit
published yet!                     $$ git commit --amend
                                     git commit --amend




      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Adding interactiv

                                    ## interactive adding
                                      interactive adding
Very useful to                      $$ git add -i
                                      git add -i
split/rearrange                     $$ git add -p
                                      git add -p

the changes
into commits




       T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Stashing

                                   ## the stash
                                     the stash
The stash, an                      $$ git stash
                                     git stash
additional space                   $$ git stash save -m 'some temp patch'
                                     git stash save -m 'some temp patch'
                                   $$ git stash pop
                                     git stash pop
to keep patches                    $$ git stash apply
                                     git stash apply




      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Rebasing

A series of commits can easily be rewritten
by git rebase
Usefull to maintain some local
patches/commits on top of
another/upstream branch
NEVER rebase anything that has been
published already!



      T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Rebase, example

## rebasing the latest two commits
  rebasing the latest two commits
$$ git rebase -i HEAD~2
  git rebase -i HEAD~2

pick c34fd56 dreinmal xx
 pick c34fd56 dreinmal
## Rebase f5614bf..c34fd56 onto f5614bf
  Rebase f5614bf..c34fd56 onto f5614bf
##
## Commands:
  Commands:
## p, pick == use commit
     p, pick use commit
## r,r, reword = use commit, but edit the commit message
      reword = use commit, but edit the commit message
## e, edit == use commit, but stop for amending
     e, edit use commit, but stop for amending
## s,s, squash = use commit, but meld into previous commit
       squash = use commit, but meld into previous commit
## f,f, fixup = like "squash", but discard this commit's log message
      fixup = like "squash", but discard this commit's log message
##
## If you remove a line here THAT COMMIT WILL BE LOST.
  If you remove a line here THAT COMMIT WILL BE LOST.
## However, if you remove everything, the rebase will be aborted.
  However, if you remove everything, the rebase will be aborted.



          T3DD10 Elmshorn, Peter Niederlag, niekom netservice
SVN interoperability

git svn
  Plugin to work on SVN repositories
Basic commands
  git svn clone [–trunk URL –tags URL
  --branches URL] URL
  git svn fetch
  git svn rebase
  Git svn dcommit
Can be done for a bare repository
          T3DD10 Elmshorn, Peter Niederlag, niekom netservice
TYPO3 Git Mirror

Clean svn mirror                $$ git clone http://github.com/typo3/typo3v4core.git
                                  git clone http://github.com/typo3/typo3v4core.git
Updated every 5
minutes
Use, fork, push
share ;)
Some (historic)
branches filtered
Unofficial
http://wiki.github.com
/typo3/typo3v4core/


         T3DD10 Elmshorn, Peter Niederlag, niekom netservice
Links

„unofficial“ TYPO3 Git Mirror
   http://github.com/typo3/typo3v4core
Videos
   http://gitcasts.com/
Git – SVN Crash Course
    http://git.or.cz/course/svn.html
Git Community Book
    http://book.git-scm.com/
Pro Git (Book)
   http://progit.org/book/
Git verstehen und nutzen
    http://chemnitzer.linux-tage.de/2009/vortraege/detail.html?idx=10
Git is MacGyver, Managing Kernel sources with Git
    http://chemnitzer.linux-tage.de/2010/vortraege/detail.html?idx=469


              T3DD10 Elmshorn, Peter Niederlag, niekom netservice

Contenu connexe

Tendances

Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7Sam Kim
 
Working with core dump
Working with core dumpWorking with core dump
Working with core dumpThierry Gayet
 
pa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processingpa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text ProcessingRodrigo Senra
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica SetsMongoDB
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)Sam Kim
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템Sam Kim
 
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03Mathias Herberts
 
Mining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentMining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentThomas Zimmermann
 
Using Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIUsing Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIDavid Beazley (Dabeaz LLC)
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012rivierarb
 
The Ring programming language version 1.2 book - Part 83 of 84
The Ring programming language version 1.2 book - Part 83 of 84The Ring programming language version 1.2 book - Part 83 of 84
The Ring programming language version 1.2 book - Part 83 of 84Mahmoud Samir Fayed
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingBoxed Ice
 
Introduction to Gstreamer
Introduction to GstreamerIntroduction to Gstreamer
Introduction to GstreamerRand Graham
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamerShih-Yuan Lee
 
The Ring programming language version 1.2 book - Part 82 of 84
The Ring programming language version 1.2 book - Part 82 of 84The Ring programming language version 1.2 book - Part 82 of 84
The Ring programming language version 1.2 book - Part 82 of 84Mahmoud Samir Fayed
 
Protecting Plone from the Big, Bad Internet
Protecting Plone from the Big, Bad InternetProtecting Plone from the Big, Bad Internet
Protecting Plone from the Big, Bad InternetErik Rose
 
Threads Advance in System Administration with Linux
Threads Advance in System Administration with LinuxThreads Advance in System Administration with Linux
Threads Advance in System Administration with LinuxSoumen Santra
 
MongoDB London 2013 - Basic Replication
MongoDB London 2013 - Basic ReplicationMongoDB London 2013 - Basic Replication
MongoDB London 2013 - Basic ReplicationMarc Schwering
 

Tendances (20)

Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
 
Working with core dump
Working with core dumpWorking with core dump
Working with core dump
 
pa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processingpa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processing
 
Replication and Replica Sets
Replication and Replica SetsReplication and Replica Sets
Replication and Replica Sets
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
 
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
Warp 10 Platform Presentation - Criteo Beer & Tech 2016-02-03
 
Mining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentMining Software Archives to Support Software Development
Mining Software Archives to Support Software Development
 
Using Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard IIUsing Python3 to Build a Cloud Computing Service for my Superboard II
Using Python3 to Build a Cloud Computing Service for my Superboard II
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012
 
The Ring programming language version 1.2 book - Part 83 of 84
The Ring programming language version 1.2 book - Part 83 of 84The Ring programming language version 1.2 book - Part 83 of 84
The Ring programming language version 1.2 book - Part 83 of 84
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueing
 
packaging
packagingpackaging
packaging
 
Introduction to Gstreamer
Introduction to GstreamerIntroduction to Gstreamer
Introduction to Gstreamer
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamer
 
The Ring programming language version 1.2 book - Part 82 of 84
The Ring programming language version 1.2 book - Part 82 of 84The Ring programming language version 1.2 book - Part 82 of 84
The Ring programming language version 1.2 book - Part 82 of 84
 
Protecting Plone from the Big, Bad Internet
Protecting Plone from the Big, Bad InternetProtecting Plone from the Big, Bad Internet
Protecting Plone from the Big, Bad Internet
 
Threads Advance in System Administration with Linux
Threads Advance in System Administration with LinuxThreads Advance in System Administration with Linux
Threads Advance in System Administration with Linux
 
Alta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/LinuxAlta disponibilidad en GNU/Linux
Alta disponibilidad en GNU/Linux
 
MongoDB London 2013 - Basic Replication
MongoDB London 2013 - Basic ReplicationMongoDB London 2013 - Basic Replication
MongoDB London 2013 - Basic Replication
 

En vedette

РИФ 2016, Как добиться использования CRM на 100%?
РИФ 2016, Как добиться использования CRM на 100%?РИФ 2016, Как добиться использования CRM на 100%?
РИФ 2016, Как добиться использования CRM на 100%?Тарасов Константин
 
Icde ossiannlisson oer_oct2011
Icde ossiannlisson oer_oct2011Icde ossiannlisson oer_oct2011
Icde ossiannlisson oer_oct2011Ebba Ossiannilsson
 
Group members
Group membersGroup members
Group membersNINANC
 
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.Тарасов Константин
 
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынок
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынокРИФ 2016, Ошибки зарубежных компаний при выходе на российский рынок
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынокТарасов Константин
 
Online Banking
Online BankingOnline Banking
Online Bankingk.shofiq
 
Unic erasmus expert_exchange2016_09_14
Unic erasmus expert_exchange2016_09_14Unic erasmus expert_exchange2016_09_14
Unic erasmus expert_exchange2016_09_14Ebba Ossiannilsson
 
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...Trabajo realizado para el curso convivencia escolar: prevención en intervenci...
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...Piluka Alburquerque
 
Efquel eMOOC stakeholders summit 2014 ossiannilsson
Efquel eMOOC stakeholders summit 2014 ossiannilssonEfquel eMOOC stakeholders summit 2014 ossiannilsson
Efquel eMOOC stakeholders summit 2014 ossiannilssonEbba Ossiannilsson
 
Project specification btec level 2 digital install
Project specification btec level 2 digital installProject specification btec level 2 digital install
Project specification btec level 2 digital installNINANC
 
Narratives
NarrativesNarratives
NarrativesNINANC
 
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...Тарасов Константин
 
Making your film make sense
Making your film make senseMaking your film make sense
Making your film make senseNINANC
 
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...Nordestcreativo social business club
 

En vedette (20)

Ossiannilsson eden2014
Ossiannilsson eden2014Ossiannilsson eden2014
Ossiannilsson eden2014
 
РИФ 2016, Как добиться использования CRM на 100%?
РИФ 2016, Как добиться использования CRM на 100%?РИФ 2016, Как добиться использования CRM на 100%?
РИФ 2016, Как добиться использования CRM на 100%?
 
Icde ossiannlisson oer_oct2011
Icde ossiannlisson oer_oct2011Icde ossiannlisson oer_oct2011
Icde ossiannlisson oer_oct2011
 
Group members
Group membersGroup members
Group members
 
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.
РИФ 2016, Миллион просмотров: эра видеоконтента в социальных сетях.
 
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынок
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынокРИФ 2016, Ошибки зарубежных компаний при выходе на российский рынок
РИФ 2016, Ошибки зарубежных компаний при выходе на российский рынок
 
Online Banking
Online BankingOnline Banking
Online Banking
 
Own cloudusermanual
Own cloudusermanualOwn cloudusermanual
Own cloudusermanual
 
Ossiannilsson TIIM2011
Ossiannilsson TIIM2011Ossiannilsson TIIM2011
Ossiannilsson TIIM2011
 
Unic erasmus expert_exchange2016_09_14
Unic erasmus expert_exchange2016_09_14Unic erasmus expert_exchange2016_09_14
Unic erasmus expert_exchange2016_09_14
 
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...Trabajo realizado para el curso convivencia escolar: prevención en intervenci...
Trabajo realizado para el curso convivencia escolar: prevención en intervenci...
 
Album
AlbumAlbum
Album
 
Efquel eMOOC stakeholders summit 2014 ossiannilsson
Efquel eMOOC stakeholders summit 2014 ossiannilssonEfquel eMOOC stakeholders summit 2014 ossiannilsson
Efquel eMOOC stakeholders summit 2014 ossiannilsson
 
Project specification btec level 2 digital install
Project specification btec level 2 digital installProject specification btec level 2 digital install
Project specification btec level 2 digital install
 
Narratives
NarrativesNarratives
Narratives
 
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...
РИФ 2016, КОНКУРЕНЦИЯ НА РЫНКЕ ЮЗАБИЛИТИ УСЛУГ ДЛЯ КРУПНЫХ И ГОСУДАРСТВЕННЫХ ...
 
Making your film make sense
Making your film make senseMaking your film make sense
Making your film make sense
 
Kth ossiannlisson 110922
Kth ossiannlisson 110922Kth ossiannlisson 110922
Kth ossiannlisson 110922
 
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...
Invito14maggio Strumenti Social E Web 2.0 Per La Competitività Di Artigiani E...
 
РИФ 2016, НЕкорпоративный портал
РИФ 2016, НЕкорпоративный порталРИФ 2016, НЕкорпоративный портал
РИФ 2016, НЕкорпоративный портал
 

Similaire à T3dd10 git

GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Gitting It Under (Version) Control
Gitting It Under (Version) ControlGitting It Under (Version) Control
Gitting It Under (Version) Controlmobiledevnj
 
Git cheat-sheets
Git cheat-sheetsGit cheat-sheets
Git cheat-sheetsozone777
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlBecky Todd
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GITArpit Mohan
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With GitHoffman Lab
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
Git Aliases of the Gods!
Git Aliases of the Gods!Git Aliases of the Gods!
Git Aliases of the Gods!Atlassian
 

Similaire à T3dd10 git (20)

Working with Git
Working with GitWorking with Git
Working with Git
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
Gitting It Under (Version) Control
Gitting It Under (Version) ControlGitting It Under (Version) Control
Gitting It Under (Version) Control
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Git cheat-sheets
Git cheat-sheetsGit cheat-sheets
Git cheat-sheets
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
git session --interactive
git session --interactivegit session --interactive
git session --interactive
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Git
GitGit
Git
 
Git basics
Git basicsGit basics
Git basics
 
Git Aliases of the Gods!
Git Aliases of the Gods!Git Aliases of the Gods!
Git Aliases of the Gods!
 
Hello git
Hello git Hello git
Hello git
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Git
GitGit
Git
 

Dernier

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

T3dd10 git

  • 1. GIT-Workshop Using GIT (distributed version control) for TYPO3- Development TYPO3 Developer Days 2010 Elmshorn Peter Niederlag T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 2. Agenda Introduction Version Control GIT vs. svn Installation Create a repository Basic wording and concepts File exclusion (.gitignore) Branching Merging Resolving Conflicts Collaboration, going remote Stashing Rebasing SVN interoperability Links T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 3. Version Control Teamwork in running project What was changed by whom, why and when? Version Control System (VCS) cvs (Concurrent version System), svn (subversion) Central, non distributed, one history, no easy local commit or history possible Distributed Version Control System (DVCS) Multiple, non-central repositories with their own full history Easy colaboration between repositories git, bazaar, mercurial, darcs, .... T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 4. GIT vs. svn Pro Distributed Leightweight branches Efficiency (fast history, disk space) rebasing Con Something new to learn Improper usage(rebasing/reset) can cause trouble T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 5. Installation Distro packages: Debian based: git-core(git), gitk, (gitweb) Fedora: git, gitk, (git-email), (gitweb), git-all (git-arch git-cvs git-email git-gui gitk git-svn perl-Git) OpenSuse: git/git-core Gentoo: dev-util/git (includes gitk and gitweb) Windows: http://code.google.com/p/msysgit/ git --help T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 6. Most Important Commands git init git config git add git clone git commit git remote git log git fetch git branch git pull git checkout git push git status git merge git reset git rebase git tag git diff git mv git blame git rm gitk T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 7. Configure git Setup e-mail and name $$ git config --global user.name "Your Name Comes Here" git config --global user.name "Your Name Comes Here" $$ git config --global user.email you@yourdomain.example.com git config --global user.email you@yourdomain.example.com Color it up $$ git config --global color.ui auto git config --global color.ui auto $$ # git config --global color.diff auto # git config --global color.diff auto $$ # git config --global color.status auto # git config --global color.status auto $$ # git config --global color.branch auto # git config --global color.branch auto $$ git config --global pager.status yes git config --global pager.status yes T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 8. Create a repository $$ mkdir myproject mkdir myproject Create a repository $$ cd myproject cd myproject (very fast) $$ git init git init $$ ## ... hack on files ... hack on files $$ git add . git add . Add files $$ git commit git commit $$ git log git log Commit Check the log T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 9. Basic wording and concepts Repository holds all versioning information and data (.git or GIT_DIR) Working tree is where the working files are, a „bare“ repository does not have a working tree The Index the glue between the working tree and the repository, sometimes also referred to as the „staging area“. Changes that are to be performed with next commit T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 10. SHA-1 Hashes Git doesn't have numeric version id's like subversion or bazaar Each object (commit, tree, blob, tag) has a unique SHA-1, which is calulated from the content by git SHA-1 can be abbreviated (at least four signs) References are used for more meaningful names for any SHA-1 of a commit Tags: refs/tags Branches: refs/heads Remotes: refs/remotes T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 11. More Work $$ git status git status Doing some more $$ # hack, hack # hack, hack work on the $$ git status git status $$ git add git add working tree $$ git status git status $$ git commit -m 'my commit message' git commit -m 'my commit message' $$ git log git log $$ git status git status T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 12. File exclusion (.gitignore) Ignoring/Excluding files .git/info/exclude (repository) .gitignore (working tree, anywhere) Reversing Exclusion Can be done by „!“ prefix !index.html T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 13. Branching ## create branch create branch Create a Branch $$ git branch myfeature git branch myfeature ## checkout branch checkout branch Checkout a Branch $$ git checkout myfeature git checkout myfeature ## shortcut, create and checkout shortcut, create and checkout List Branches $$ git checkout -b myfeature git checkout -b myfeature Delete Branch ## list available branches list available branches $$ git branch -av git branch -av Rename a Branch ## delete branch delete branch $$ git branch -d obsoletebranch git branch -d obsoletebranch ## rename a branch rename a branch $$ git branch -m oldname newname git branch -m oldname newname T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 14. .git/config .git/config Holds configuration for the repository Setup of branches and remotes Default setup for merging of branches T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 15. Work on any branch $$ git branch git branch Doing some more $$ git checkout whatever git checkout whatever work on any $$ # hack, hack # hack, hack $$ git status git status branch (git branch, $$ git add git add $$ git status git status git checkout, git $$ git commit -m 'my commit message' git commit -m 'my commit message' $$ git log git log commit) $$ git status git status $$ git branch git branch $$ git checkout whatever git checkout whatever T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 16. Merging ## merge another branch merge another branch Merging $$ git merge otherbranch git merge otherbranch Fast Forward ## merge, withoud committing merge, withoud committing $$ git merge –no-commit otherbranch git merge –no-commit otherbranch fast-forward is a special case of a ## merge, but combine all commits into one merge, but combine all commits into one $$ git merge –squash otherbranch git merge –squash otherbranch merge, where only the other branch has additional commits and our branch can just be „moved forward“ T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 17. Resolving Conflicts Conflict ## merge another branch merge another branch $$ git merge otherbranch git merge otherbranch when ... CONFLICT (content): Merge conflict in foobar ... CONFLICT (content): Merge conflict in foobar Automatic merge failed; fix conflicts and then commit the result Automatic merge failed; fix conflicts and then commit the result merging $$ git status git status ... ... ## both modified: foobar both modified: foobar ..... ..... $$ git diff; git diff –ours; git diff –theirs git diff; git diff –ours; git diff –theirs ## resolve resolve $$ „edit file to solve the conflict“ „edit file to solve the conflict“ $$ git add foobar git add foobar $$ git commit git commit ## alternativ: alternativ: $$ git mergetool git mergetool T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 18. Collaboration, going remote remotes ## remotes remotes $$ git remote git remote Adding other $$ git remote add myname URL git remote add myname URL repositories for cowork $$ cat .git/config cat .git/config By default remote is $$ git remote add pn git remote add pn called „origin“ http://h01.niekom.de/sandbox.git http://h01.niekom.de/sandbox.git git clone is shortcut Create rep Add remote Add local branch that tracks remote branch T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 19. Remotes: fetch, pull, push git fetch Fetches any remote commits git pull Fetches any remote commits and merges them, boils down to git fetch plus git merge git push Pushes any „new“ local commits to the Remote T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 20. Change latest commit ## change the most recent commit change the most recent commit ATTENTION $$ git commit --amend git commit --amend only use if the ## hack, add, remove files to the index hack, add, remove files to the index commit was not ## change the most recent commit change the most recent commit published yet! $$ git commit --amend git commit --amend T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 21. Adding interactiv ## interactive adding interactive adding Very useful to $$ git add -i git add -i split/rearrange $$ git add -p git add -p the changes into commits T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 22. Stashing ## the stash the stash The stash, an $$ git stash git stash additional space $$ git stash save -m 'some temp patch' git stash save -m 'some temp patch' $$ git stash pop git stash pop to keep patches $$ git stash apply git stash apply T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 23. Rebasing A series of commits can easily be rewritten by git rebase Usefull to maintain some local patches/commits on top of another/upstream branch NEVER rebase anything that has been published already! T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 24. Rebase, example ## rebasing the latest two commits rebasing the latest two commits $$ git rebase -i HEAD~2 git rebase -i HEAD~2 pick c34fd56 dreinmal xx pick c34fd56 dreinmal ## Rebase f5614bf..c34fd56 onto f5614bf Rebase f5614bf..c34fd56 onto f5614bf ## ## Commands: Commands: ## p, pick == use commit p, pick use commit ## r,r, reword = use commit, but edit the commit message reword = use commit, but edit the commit message ## e, edit == use commit, but stop for amending e, edit use commit, but stop for amending ## s,s, squash = use commit, but meld into previous commit squash = use commit, but meld into previous commit ## f,f, fixup = like "squash", but discard this commit's log message fixup = like "squash", but discard this commit's log message ## ## If you remove a line here THAT COMMIT WILL BE LOST. If you remove a line here THAT COMMIT WILL BE LOST. ## However, if you remove everything, the rebase will be aborted. However, if you remove everything, the rebase will be aborted. T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 25. SVN interoperability git svn Plugin to work on SVN repositories Basic commands git svn clone [–trunk URL –tags URL --branches URL] URL git svn fetch git svn rebase Git svn dcommit Can be done for a bare repository T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 26. TYPO3 Git Mirror Clean svn mirror $$ git clone http://github.com/typo3/typo3v4core.git git clone http://github.com/typo3/typo3v4core.git Updated every 5 minutes Use, fork, push share ;) Some (historic) branches filtered Unofficial http://wiki.github.com /typo3/typo3v4core/ T3DD10 Elmshorn, Peter Niederlag, niekom netservice
  • 27. Links „unofficial“ TYPO3 Git Mirror http://github.com/typo3/typo3v4core Videos http://gitcasts.com/ Git – SVN Crash Course http://git.or.cz/course/svn.html Git Community Book http://book.git-scm.com/ Pro Git (Book) http://progit.org/book/ Git verstehen und nutzen http://chemnitzer.linux-tage.de/2009/vortraege/detail.html?idx=10 Git is MacGyver, Managing Kernel sources with Git http://chemnitzer.linux-tage.de/2010/vortraege/detail.html?idx=469 T3DD10 Elmshorn, Peter Niederlag, niekom netservice