SlideShare a Scribd company logo
1 of 59
Download to read offline
git
                         Podstawy


                            Tymon Tobolski
                         Koło Naukowe iLabs
                       Politechnika Wrocławska




wtorek, 11 maja 2010
Dlaczego git?



wtorek, 11 maja 2010
wtorek, 11 maja 2010
Instalacja




wtorek, 11 maja 2010
albo...


                       $ sudo port install git-core




wtorek, 11 maja 2010
Konfiguracja

                       ~ $ git config --global user.name ”Tymon Tobolski”
                       ~ $ git config --global user.email ”i@teamon.eu”




wtorek, 11 maja 2010
Konfiguracja

                       ~ $ git config --global user.name ”Tymon Tobolski”
                       ~ $ git config --global user.email ”i@teamon.eu”

                       ~ $ cat .gitconfig
                       [user]
                       ! name = Tymon Tobolski
                       ! email = i@teamon.eu




wtorek, 11 maja 2010
Komendy
                 add               clone                 fsck         merge-file      quiltimport        show-ref
                 am             clone-pack                 gc       merge-index        read-tree          stash
              annotate            commit       get-tar-commit-id     merge-tree          rebase           status
                apply          commit-tree              grep         mergetool            reflog            svn
            applymbox              config          hash-object           mktag             relink       svnimport
            applypatch       convert-objects       imap-send           mktree            remote       symbolic-ref
            archimport        count-objects       index-pack             mv              repack             tag
               archive      cvsexportcommit               init        name-rev       request-pull        tar-tree
                bisect          cvsimport            instaweb       pack-objects          rerere       unpack-file
                blame            describe          local-fetch     pack-redundant          reset     unpack-objects
               branch                diff                 log         pack-refs          rev-list     update-index
               cat-file            diff-files        lost-found       parse-remote          revert       update-ref
             check-attr          diff-index            ls-files         patch-id             rm      update-server-info
         check-ref-format       diff-stages         ls-remote       peek-remote       send-email           var
              checkout            diff-tree           ls-tree           prune           shortlog       verify-pack
          checkout-index            fetch             mailinfo      prune-packed           show         verify-tag
               cherry           fetch-pack           mailsplit           pull       show-branch       whatchanged
            cherry-pick        for-each-ref            merge            push         show-index        write-tree
                clean         format-patch        merge-base




wtorek, 11 maja 2010
Komendy
                 add               clone                 fsck         merge-file      quiltimport        show-ref
                 am             clone-pack                 gc       merge-index        read-tree          stash
              annotate            commit       get-tar-commit-id     merge-tree          rebase           status
                apply          commit-tree              grep         mergetool            reflog            svn
            applymbox              config          hash-object           mktag             relink       svnimport
            applypatch       convert-objects       imap-send           mktree            remote       symbolic-ref
            archimport        count-objects       index-pack             mv              repack             tag
               archive      cvsexportcommit               init        name-rev       request-pull        tar-tree
                bisect          cvsimport            instaweb       pack-objects          rerere       unpack-file
                blame            describe          local-fetch     pack-redundant          reset     unpack-objects
               branch                diff                 log         pack-refs          rev-list     update-index
               cat-file            diff-files        lost-found       parse-remote          revert       update-ref
             check-attr          diff-index            ls-files         patch-id             rm      update-server-info
         check-ref-format       diff-stages         ls-remote       peek-remote       send-email           var
              checkout            diff-tree           ls-tree           prune           shortlog       verify-pack
          checkout-index            fetch             mailinfo      prune-packed           show         verify-tag
               cherry           fetch-pack           mailsplit           pull       show-branch       whatchanged
            cherry-pick        for-each-ref            merge            push         show-index        write-tree
                clean         format-patch        merge-base




wtorek, 11 maja 2010
git init

         ~ $ mkdir ilabs
         ~ $ cd ilabs




wtorek, 11 maja 2010
git init

         ~ $ mkdir ilabs
         ~ $ cd ilabs
         ~/ilabs $ git init
         Initialized empty Git repository in /Users/teamon/ilabs/.git/




wtorek, 11 maja 2010
Nie ma folderow .svn !



                                     git init

                  ~/ilabs $ ls -la
                  total 0
                  drwxr-xr-x   3 teamon   staff    102   2 maj 15:02 ./
                  drwxr-xr-x+ 72 teamon   staff   2448   2 maj 15:02 ../
                  drwxr-xr-x 11 teamon    staff    374   2 maj 15:05 .git/




wtorek, 11 maja 2010
Katalog roboczy

                                          git add

                       edycja     Staging area

                                          git commit

                                Repozytorium


wtorek, 11 maja 2010
git status

         ~/ilabs $ git status
         # On branch master
         #
         # Initial commit
         #
         nothing to commit (create/copy files and use "git add" to
         track)




wtorek, 11 maja 2010
git status
   ~/ilabs $ echo "KN iLabs" > README




wtorek, 11 maja 2010
git status
   ~/ilabs $ echo "KN iLabs" > README
   ~/ilabs $ git status
   # On branch master
   #
   # Initial commit
   #
   # Untracked files:
   #   (use "git add <file>..." to include in what will be committed)
   #
   #! README
   nothing added to commit but untracked files present (use "git add"
   to track)




wtorek, 11 maja 2010
git add
                       ~/ilabs $ git add README




wtorek, 11 maja 2010
git add
                       ~/ilabs $ git add README
                       ~/ilabs $ git status
                       # On branch master
                       #
                       # Initial commit
                       #
                       # Changes to be committed:
                       #   (use "git rm --cached <file>..." to unstage)
                       #
                       #! new file:   README
                       #




wtorek, 11 maja 2010
git commit
                       ~/ilabs $ git commit -m "First commit"
                       [master (root-commit) 28dc8e9] First commit
                        1 files changed, 1 insertions(+), 0 deletions(-)
                        create mode 100644 README




wtorek, 11 maja 2010
git commit
                       ~/ilabs $ git commit -m "First commit"
                       [master (root-commit) 28dc8e9] First commit
                        1 files changed, 1 insertions(+), 0 deletions(-)
                        create mode 100644 README

                       ~/ilabs $ git status
                       # On branch master
                       nothing to commit (working directory clean)




wtorek, 11 maja 2010
git log
                       ~/ilabs $ git log
                       commit 28dc8e941ac55657cc633575967a7e72dd3ea898
                       Author: Tymon Tobolski <i@teamon.eu>
                       Date:   Sun May 2 15:23:58 2010 +0200

                           First commit




wtorek, 11 maja 2010
git log
                       ~/ilabs $ git log
                       commit 66c61ef16075eccbfd4f015e3e12c6c5f87c29d0
                       Author: Tymon Tobolski <i@teamon.eu>
                       Date:   Sun May 2 15:51:53 2010 +0200

                           Next one

                       commit 595ae522a0b115535f166813e31538b4f7119013
                       Author: Tymon Tobolski <i@teamon.eu>
                       Date:   Sun May 2 15:51:40 2010 +0200

                           Second commit

                       commit 28dc8e941ac55657cc633575967a7e72dd3ea898
                       Author: Tymon Tobolski <i@teamon.eu>
                       Date:   Sun May 2 15:23:58 2010 +0200

                           First commit

wtorek, 11 maja 2010
Workflow
                            MESSAGE: Next one
                       c3       SHA: 66c61ef16075eccbfd4f015e3e12c6c5f87c29d0
                             PARENT: 595ae522a0b115535f166813e31538b4f7119013




                            MESSAGE: Second commit
                       c2       SHA: 595ae522a0b115535f166813e31538b4f7119013
                             PARENT: 28dc8e941ac55657cc633575967a7e72dd3ea898




                            MESSAGE: First commit
                       c1       SHA: 28dc8e941ac55657cc633575967a7e72dd3ea898




wtorek, 11 maja 2010
git branch



wtorek, 11 maja 2010
git branch

                       c1   c2   c3   c4   master


                                 c5   c6   feature




wtorek, 11 maja 2010
git branch / checkout
                        ~/ilabs $ git branch feature




wtorek, 11 maja 2010
git branch / checkout
                        ~/ilabs $ git branch feature

                        ~/ilabs $ git branch
                          feature
                        * master




wtorek, 11 maja 2010
git branch / checkout
                        ~/ilabs $ git branch feature

                        ~/ilabs $ git branch
                          feature
                        * master

                        ~/ilabs $ git checkout feature
                        Switched to branch 'feature'




wtorek, 11 maja 2010
git branch / checkout
                        ~/ilabs $ git branch feature

                        ~/ilabs $ git branch
                          feature
                        * master

                        ~/ilabs $ git checkout feature
                        Switched to branch 'feature'

                        ~/ilabs $ git branch
                        * feature
                          master




wtorek, 11 maja 2010
git branch / checkout

                           git branch feature
                          git checkout feature

                                  ==

                        git checkout -b feature



wtorek, 11 maja 2010
git merge



wtorek, 11 maja 2010
git merge




wtorek, 11 maja 2010
git merge

            master ...     c3   c4    c7   master



            feature ...    c5   c6




wtorek, 11 maja 2010
git merge
                                           SHA: 8f06c...20e83
                                      c7




                 SHA: 81f23...b9942   c4                        c6   SHA: 9dc8d...d497f




wtorek, 11 maja 2010
git merge
                                           SHA: 8f06c...20e83
                                      c7   PARENT: 81f23...b9942




                 SHA: 81f23...b9942   c4                      c6   SHA: 9dc8d...d497f




wtorek, 11 maja 2010
git merge
                                           SHA: 8f06c...20e83
                                      c7   PARENT: 81f23...b9942
                                           PARENT: 9dc8d...d497f




                 SHA: 81f23...b9942   c4                      c6   SHA: 9dc8d...d497f




wtorek, 11 maja 2010
git merge

                       ~/ilabs $ git checkout master
                       Switched to branch 'master'




wtorek, 11 maja 2010
git merge

                       ~/ilabs $ git checkout master
                       Switched to branch 'master'

                       ~/ilabs $ git merge feature
                       Merge made by recursive.
                       1 files changed, 1 insertions(+), 0
                       deletions(-)




wtorek, 11 maja 2010
git stash
        ~/ilabs $ git stash
        Switched to branch 'master'




wtorek, 11 maja 2010
git stash
        ~/ilabs $ git stash
        Switched to branch 'master'

        ~/ilabs $ echo "666" >> README




wtorek, 11 maja 2010
git stash
        ~/ilabs $ git stash
        Switched to branch 'master'

        ~/ilabs $ echo "666" >> README

        ~/ilabs $ git status
        # On branch master
        # Changed but not updated:
        #   (use "git add <file>..." to update what will be committed)
        #   (use "git checkout -- <file>..." to discard changes in
        working directory)
        #
        #! modified:   README
        #
        no changes added to commit (use "git add" and/or "git commit -
        a")




wtorek, 11 maja 2010
git stash
        ~/ilabs $ cat README
        asd
        666




wtorek, 11 maja 2010
git stash
        ~/ilabs $ cat README
        asd
        666

        ~/ilabs $ git stash
        Saved working directory and index state WIP on master: 992f518
        Merge branch 'foo'
        HEAD is now at 992f518 Merge branch 'foo'




wtorek, 11 maja 2010
git stash
        ~/ilabs $ cat README
        asd
        666

        ~/ilabs $ git stash
        Saved working directory and index state WIP on master: 992f518
        Merge branch 'foo'
        HEAD is now at 992f518 Merge branch 'foo'

        ~/ilabs $ git status
        # On branch master
        nothing to commit (working directory clean)




wtorek, 11 maja 2010
git stash
        ~/ilabs $ cat README
        asd
        666

        ~/ilabs $ git stash
        Saved working directory and index state WIP on master: 992f518
        Merge branch 'foo'
        HEAD is now at 992f518 Merge branch 'foo'

        ~/ilabs $ git status
        # On branch master
        nothing to commit (working directory clean)

        ~/ilabs $ cat README
        asd




wtorek, 11 maja 2010
git stash
        ~/ilabs $ git stash apply
        # On branch master
        # Changed but not updated:
        #   (use "git add <file>..." to update what will be committed)
        #   (use "git checkout -- <file>..." to discard changes in
        working directory)
        #
        #! modified:   README
        #
        no changes added to commit (use "git add" and/or "git commit -
        a")




wtorek, 11 maja 2010
git stash
        ~/ilabs $ git stash apply
        # On branch master
        # Changed but not updated:
        #   (use "git add <file>..." to update what will be committed)
        #   (use "git checkout -- <file>..." to discard changes in
        working directory)
        #
        #! modified:   README
        #
        no changes added to commit (use "git add" and/or "git commit -
        a")

        ~/ilabs $ cat README
        asd
        666




wtorek, 11 maja 2010
Remote




wtorek, 11 maja 2010
github




wtorek, 11 maja 2010
github




wtorek, 11 maja 2010
git clone
                   ~ $ git clone git@github.com:teamon/synergio.git




wtorek, 11 maja 2010
git clone
                   ~ $ git clone git@github.com:teamon/synergio.git
                   Initialized empty Git repository in /Users/teamon/
                   Desktop/synergio/.git/
                   remote: Counting objects: 140, done.
                   remote: Compressing objects: 100% (129/129), done.
                   remote: Total 140 (delta 64), reused 0 (delta 0)
                   Receiving objects: 100% (140/140), 159.13 KiB | 99
                   KiB/s, done.
                   Resolving deltas: 100% (64/64), done.




wtorek, 11 maja 2010
git remote
                       ~ $ cd synergio
                       ~/synergio $ git remote
                       origin




wtorek, 11 maja 2010
git remote
                       ~ $ cd synergio
                       ~/synergio $ git remote
                       origin

                       ~/synergio $ git remote show origin
                       * remote origin
                         Fetch URL: git@github.com:teamon/synergio.git
                         Push URL: git@github.com:teamon/synergio.git
                         HEAD branch: master
                         Remote branch:
                           master tracked
                         Local branch configured for 'git pull':
                           master merges with remote master
                         Local ref configured for 'git push':
                           master pushes to master (fast forwardable)




wtorek, 11 maja 2010
git push

                       ~/synergio $ git push origin master
                       Counting objects: 5, done.
                       Delta compression using up to 2 threads.
                       Compressing objects: 100% (3/3), done.
                       Writing objects: 100% (3/3), 287 bytes, done.
                       Total 3 (delta 2), reused 0 (delta 0)
                       To git@github.com:teamon/synergio.git
                          4826a55..fd8157e master -> master




wtorek, 11 maja 2010
git pull
                   ~/synergio $ git pull origin master
                   From github.com:teamon/synergio
                    * branch            master     -> FETCH_HEAD
                   Removing resources/app_j.js
                   Merge made by recursive.
                    resources/app_j.js | 201
                   ----------------------------------------------------
                    1 files changed, 0 insertions(+), 201 deletions(-)
                    delete mode 100644 resources/app_j.js




wtorek, 11 maja 2010
GitX




wtorek, 11 maja 2010
GitX


                       • http://gitx.frim.nl - wersja stabilna
                       • http://brotherbard.com/blog/2010/03/
                         experimental-gitx-fork/




wtorek, 11 maja 2010
Prezentacja do
                          pobrania

                       http://s.teamon.eu/Git.pdf




wtorek, 11 maja 2010

More Related Content

What's hot

Licão 06 process text streams with filters
Licão 06 process text streams with filtersLicão 06 process text streams with filters
Licão 06 process text streams with filtersAcácio Oliveira
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testingGaruda Trainings
 
Orchestrating MySQL with Python and Docker
Orchestrating MySQL with Python and DockerOrchestrating MySQL with Python and Docker
Orchestrating MySQL with Python and DockerRoberto Polli
 
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and RailsAnchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and RailsEleanor McHugh
 
White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...Perforce
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersDavide Ciambelli
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Martijn Verburg
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebookYash Gulati
 
2.4.1 use debian package management v2
2.4.1 use debian package management v22.4.1 use debian package management v2
2.4.1 use debian package management v2Acácio Oliveira
 
Puppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi ExercisesPuppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi ExercisesJulie Tsai
 
One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manualdummy
 

What's hot (20)

Licão 06 process text streams with filters
Licão 06 process text streams with filtersLicão 06 process text streams with filters
Licão 06 process text streams with filters
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
Linux class 8 tar
Linux class 8   tar  Linux class 8   tar
Linux class 8 tar
 
Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
 
Orchestrating MySQL with Python and Docker
Orchestrating MySQL with Python and DockerOrchestrating MySQL with Python and Docker
Orchestrating MySQL with Python and Docker
 
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and RailsAnchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
Anchoring Trust: Rewriting DNS for the Semantic Network with Ruby and Rails
 
White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...White Paper: Perforce Administration Optimization, Scalability, Availability ...
White Paper: Perforce Administration Optimization, Scalability, Availability ...
 
Linux And perl
Linux And perlLinux And perl
Linux And perl
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Linux class 9 15 oct 2021-5
Linux class 9   15 oct 2021-5Linux class 9   15 oct 2021-5
Linux class 9 15 oct 2021-5
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for Beginners
 
Linux class 10 15 oct 2021-6
Linux class 10   15 oct 2021-6Linux class 10   15 oct 2021-6
Linux class 10 15 oct 2021-6
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
2.4.1 use debian package management v2
2.4.1 use debian package management v22.4.1 use debian package management v2
2.4.1 use debian package management v2
 
Puppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi ExercisesPuppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi Exercises
 
One Page Linux Manual
One Page Linux ManualOne Page Linux Manual
One Page Linux Manual
 

Similar to Git-podstawy

Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Andrew Romanenco
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Object Storage with Gluster
Object Storage with GlusterObject Storage with Gluster
Object Storage with GlusterGluster.org
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Hadoop - Lessons Learned
Hadoop - Lessons LearnedHadoop - Lessons Learned
Hadoop - Lessons Learnedtcurdt
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfDangGonz
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_pptMiraz Al-Mamun
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係Kiwamu Okabe
 
インフラエンジニアのためのGit入門
インフラエンジニアのためのGit入門インフラエンジニアのためのGit入門
インフラエンジニアのためのGit入門Kouhei Maeda
 
Hudson以外の何か with 任意
Hudson以外の何か with 任意Hudson以外の何か with 任意
Hudson以外の何か with 任意bleis tift
 
Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Ubuntu Korea Community
 
Subversion workshop
Subversion workshopSubversion workshop
Subversion workshopTrafeX
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemTommaso Visconti
 

Similar to Git-podstawy (20)

Git tricks
Git tricksGit tricks
Git tricks
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.Git/Github/Bitbucket@TalkIt. Humber college.
Git/Github/Bitbucket@TalkIt. Humber college.
 
T3dd10 git
T3dd10 gitT3dd10 git
T3dd10 git
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
Git
GitGit
Git
 
Object Storage with Gluster
Object Storage with GlusterObject Storage with Gluster
Object Storage with Gluster
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Capistrano Rails
Capistrano RailsCapistrano Rails
Capistrano Rails
 
git internals
git internalsgit internals
git internals
 
Hadoop - Lessons Learned
Hadoop - Lessons LearnedHadoop - Lessons Learned
Hadoop - Lessons Learned
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdf
 
Get going with_git_ppt
Get going with_git_pptGet going with_git_ppt
Get going with_git_ppt
 
HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係HaskellとDebianの辛くて甘い関係
HaskellとDebianの辛くて甘い関係
 
インフラエンジニアのためのGit入門
インフラエンジニアのためのGit入門インフラエンジニアのためのGit入門
インフラエンジニアのためのGit入門
 
Hudson以外の何か with 任意
Hudson以外の何か with 任意Hudson以外の何か with 任意
Hudson以外の何か with 任意
 
Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)Linux Kernel 개발참여방법과 문화 (Contribution)
Linux Kernel 개발참여방법과 문화 (Contribution)
 
Subversion workshop
Subversion workshopSubversion workshop
Subversion workshop
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 

Recently uploaded

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

Git-podstawy

  • 1. git Podstawy Tymon Tobolski Koło Naukowe iLabs Politechnika Wrocławska wtorek, 11 maja 2010
  • 5. albo... $ sudo port install git-core wtorek, 11 maja 2010
  • 6. Konfiguracja ~ $ git config --global user.name ”Tymon Tobolski” ~ $ git config --global user.email ”i@teamon.eu” wtorek, 11 maja 2010
  • 7. Konfiguracja ~ $ git config --global user.name ”Tymon Tobolski” ~ $ git config --global user.email ”i@teamon.eu” ~ $ cat .gitconfig [user] ! name = Tymon Tobolski ! email = i@teamon.eu wtorek, 11 maja 2010
  • 8. Komendy add clone fsck merge-file quiltimport show-ref am clone-pack gc merge-index read-tree stash annotate commit get-tar-commit-id merge-tree rebase status apply commit-tree grep mergetool reflog svn applymbox config hash-object mktag relink svnimport applypatch convert-objects imap-send mktree remote symbolic-ref archimport count-objects index-pack mv repack tag archive cvsexportcommit init name-rev request-pull tar-tree bisect cvsimport instaweb pack-objects rerere unpack-file blame describe local-fetch pack-redundant reset unpack-objects branch diff log pack-refs rev-list update-index cat-file diff-files lost-found parse-remote revert update-ref check-attr diff-index ls-files patch-id rm update-server-info check-ref-format diff-stages ls-remote peek-remote send-email var checkout diff-tree ls-tree prune shortlog verify-pack checkout-index fetch mailinfo prune-packed show verify-tag cherry fetch-pack mailsplit pull show-branch whatchanged cherry-pick for-each-ref merge push show-index write-tree clean format-patch merge-base wtorek, 11 maja 2010
  • 9. Komendy add clone fsck merge-file quiltimport show-ref am clone-pack gc merge-index read-tree stash annotate commit get-tar-commit-id merge-tree rebase status apply commit-tree grep mergetool reflog svn applymbox config hash-object mktag relink svnimport applypatch convert-objects imap-send mktree remote symbolic-ref archimport count-objects index-pack mv repack tag archive cvsexportcommit init name-rev request-pull tar-tree bisect cvsimport instaweb pack-objects rerere unpack-file blame describe local-fetch pack-redundant reset unpack-objects branch diff log pack-refs rev-list update-index cat-file diff-files lost-found parse-remote revert update-ref check-attr diff-index ls-files patch-id rm update-server-info check-ref-format diff-stages ls-remote peek-remote send-email var checkout diff-tree ls-tree prune shortlog verify-pack checkout-index fetch mailinfo prune-packed show verify-tag cherry fetch-pack mailsplit pull show-branch whatchanged cherry-pick for-each-ref merge push show-index write-tree clean format-patch merge-base wtorek, 11 maja 2010
  • 10. git init ~ $ mkdir ilabs ~ $ cd ilabs wtorek, 11 maja 2010
  • 11. git init ~ $ mkdir ilabs ~ $ cd ilabs ~/ilabs $ git init Initialized empty Git repository in /Users/teamon/ilabs/.git/ wtorek, 11 maja 2010
  • 12. Nie ma folderow .svn ! git init ~/ilabs $ ls -la total 0 drwxr-xr-x 3 teamon staff 102 2 maj 15:02 ./ drwxr-xr-x+ 72 teamon staff 2448 2 maj 15:02 ../ drwxr-xr-x 11 teamon staff 374 2 maj 15:05 .git/ wtorek, 11 maja 2010
  • 13. Katalog roboczy git add edycja Staging area git commit Repozytorium wtorek, 11 maja 2010
  • 14. git status ~/ilabs $ git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track) wtorek, 11 maja 2010
  • 15. git status ~/ilabs $ echo "KN iLabs" > README wtorek, 11 maja 2010
  • 16. git status ~/ilabs $ echo "KN iLabs" > README ~/ilabs $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # #! README nothing added to commit but untracked files present (use "git add" to track) wtorek, 11 maja 2010
  • 17. git add ~/ilabs $ git add README wtorek, 11 maja 2010
  • 18. git add ~/ilabs $ git add README ~/ilabs $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # #! new file: README # wtorek, 11 maja 2010
  • 19. git commit ~/ilabs $ git commit -m "First commit" [master (root-commit) 28dc8e9] First commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 README wtorek, 11 maja 2010
  • 20. git commit ~/ilabs $ git commit -m "First commit" [master (root-commit) 28dc8e9] First commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 README ~/ilabs $ git status # On branch master nothing to commit (working directory clean) wtorek, 11 maja 2010
  • 21. git log ~/ilabs $ git log commit 28dc8e941ac55657cc633575967a7e72dd3ea898 Author: Tymon Tobolski <i@teamon.eu> Date: Sun May 2 15:23:58 2010 +0200 First commit wtorek, 11 maja 2010
  • 22. git log ~/ilabs $ git log commit 66c61ef16075eccbfd4f015e3e12c6c5f87c29d0 Author: Tymon Tobolski <i@teamon.eu> Date: Sun May 2 15:51:53 2010 +0200 Next one commit 595ae522a0b115535f166813e31538b4f7119013 Author: Tymon Tobolski <i@teamon.eu> Date: Sun May 2 15:51:40 2010 +0200 Second commit commit 28dc8e941ac55657cc633575967a7e72dd3ea898 Author: Tymon Tobolski <i@teamon.eu> Date: Sun May 2 15:23:58 2010 +0200 First commit wtorek, 11 maja 2010
  • 23. Workflow MESSAGE: Next one c3 SHA: 66c61ef16075eccbfd4f015e3e12c6c5f87c29d0 PARENT: 595ae522a0b115535f166813e31538b4f7119013 MESSAGE: Second commit c2 SHA: 595ae522a0b115535f166813e31538b4f7119013 PARENT: 28dc8e941ac55657cc633575967a7e72dd3ea898 MESSAGE: First commit c1 SHA: 28dc8e941ac55657cc633575967a7e72dd3ea898 wtorek, 11 maja 2010
  • 25. git branch c1 c2 c3 c4 master c5 c6 feature wtorek, 11 maja 2010
  • 26. git branch / checkout ~/ilabs $ git branch feature wtorek, 11 maja 2010
  • 27. git branch / checkout ~/ilabs $ git branch feature ~/ilabs $ git branch feature * master wtorek, 11 maja 2010
  • 28. git branch / checkout ~/ilabs $ git branch feature ~/ilabs $ git branch feature * master ~/ilabs $ git checkout feature Switched to branch 'feature' wtorek, 11 maja 2010
  • 29. git branch / checkout ~/ilabs $ git branch feature ~/ilabs $ git branch feature * master ~/ilabs $ git checkout feature Switched to branch 'feature' ~/ilabs $ git branch * feature master wtorek, 11 maja 2010
  • 30. git branch / checkout git branch feature git checkout feature == git checkout -b feature wtorek, 11 maja 2010
  • 31. git merge wtorek, 11 maja 2010
  • 32. git merge wtorek, 11 maja 2010
  • 33. git merge master ... c3 c4 c7 master feature ... c5 c6 wtorek, 11 maja 2010
  • 34. git merge SHA: 8f06c...20e83 c7 SHA: 81f23...b9942 c4 c6 SHA: 9dc8d...d497f wtorek, 11 maja 2010
  • 35. git merge SHA: 8f06c...20e83 c7 PARENT: 81f23...b9942 SHA: 81f23...b9942 c4 c6 SHA: 9dc8d...d497f wtorek, 11 maja 2010
  • 36. git merge SHA: 8f06c...20e83 c7 PARENT: 81f23...b9942 PARENT: 9dc8d...d497f SHA: 81f23...b9942 c4 c6 SHA: 9dc8d...d497f wtorek, 11 maja 2010
  • 37. git merge ~/ilabs $ git checkout master Switched to branch 'master' wtorek, 11 maja 2010
  • 38. git merge ~/ilabs $ git checkout master Switched to branch 'master' ~/ilabs $ git merge feature Merge made by recursive. 1 files changed, 1 insertions(+), 0 deletions(-) wtorek, 11 maja 2010
  • 39. git stash ~/ilabs $ git stash Switched to branch 'master' wtorek, 11 maja 2010
  • 40. git stash ~/ilabs $ git stash Switched to branch 'master' ~/ilabs $ echo "666" >> README wtorek, 11 maja 2010
  • 41. git stash ~/ilabs $ git stash Switched to branch 'master' ~/ilabs $ echo "666" >> README ~/ilabs $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # #! modified: README # no changes added to commit (use "git add" and/or "git commit - a") wtorek, 11 maja 2010
  • 42. git stash ~/ilabs $ cat README asd 666 wtorek, 11 maja 2010
  • 43. git stash ~/ilabs $ cat README asd 666 ~/ilabs $ git stash Saved working directory and index state WIP on master: 992f518 Merge branch 'foo' HEAD is now at 992f518 Merge branch 'foo' wtorek, 11 maja 2010
  • 44. git stash ~/ilabs $ cat README asd 666 ~/ilabs $ git stash Saved working directory and index state WIP on master: 992f518 Merge branch 'foo' HEAD is now at 992f518 Merge branch 'foo' ~/ilabs $ git status # On branch master nothing to commit (working directory clean) wtorek, 11 maja 2010
  • 45. git stash ~/ilabs $ cat README asd 666 ~/ilabs $ git stash Saved working directory and index state WIP on master: 992f518 Merge branch 'foo' HEAD is now at 992f518 Merge branch 'foo' ~/ilabs $ git status # On branch master nothing to commit (working directory clean) ~/ilabs $ cat README asd wtorek, 11 maja 2010
  • 46. git stash ~/ilabs $ git stash apply # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # #! modified: README # no changes added to commit (use "git add" and/or "git commit - a") wtorek, 11 maja 2010
  • 47. git stash ~/ilabs $ git stash apply # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # #! modified: README # no changes added to commit (use "git add" and/or "git commit - a") ~/ilabs $ cat README asd 666 wtorek, 11 maja 2010
  • 51. git clone ~ $ git clone git@github.com:teamon/synergio.git wtorek, 11 maja 2010
  • 52. git clone ~ $ git clone git@github.com:teamon/synergio.git Initialized empty Git repository in /Users/teamon/ Desktop/synergio/.git/ remote: Counting objects: 140, done. remote: Compressing objects: 100% (129/129), done. remote: Total 140 (delta 64), reused 0 (delta 0) Receiving objects: 100% (140/140), 159.13 KiB | 99 KiB/s, done. Resolving deltas: 100% (64/64), done. wtorek, 11 maja 2010
  • 53. git remote ~ $ cd synergio ~/synergio $ git remote origin wtorek, 11 maja 2010
  • 54. git remote ~ $ cd synergio ~/synergio $ git remote origin ~/synergio $ git remote show origin * remote origin Fetch URL: git@github.com:teamon/synergio.git Push URL: git@github.com:teamon/synergio.git HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (fast forwardable) wtorek, 11 maja 2010
  • 55. git push ~/synergio $ git push origin master Counting objects: 5, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 287 bytes, done. Total 3 (delta 2), reused 0 (delta 0) To git@github.com:teamon/synergio.git 4826a55..fd8157e master -> master wtorek, 11 maja 2010
  • 56. git pull ~/synergio $ git pull origin master From github.com:teamon/synergio * branch master -> FETCH_HEAD Removing resources/app_j.js Merge made by recursive. resources/app_j.js | 201 ---------------------------------------------------- 1 files changed, 0 insertions(+), 201 deletions(-) delete mode 100644 resources/app_j.js wtorek, 11 maja 2010
  • 58. GitX • http://gitx.frim.nl - wersja stabilna • http://brotherbard.com/blog/2010/03/ experimental-gitx-fork/ wtorek, 11 maja 2010
  • 59. Prezentacja do pobrania http://s.teamon.eu/Git.pdf wtorek, 11 maja 2010