GIT rozproszony system kontroli wersji

1,701 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,701
On SlideShare
0
From Embeds
0
Number of Embeds
984
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

GIT rozproszony system kontroli wersji

  1. 1. ! #
  2. 2. ! ! $ % ()
  3. 3. # !*+ ,-, !) .
  4. 4. )
  5. 5. /
  6. 6. 0
  7. 7. !* 1 0
  8. 8. ( , 23,45 5 ,5 6 -%78 9 2
  9. 9. !$ sudo apt-get install git$ git config --global user.name Piotr Macuk$ git config --global user.email piotr@macuk.pl/etc/gitconfig~/.gitconfig.git/configgit help config
  10. 10. % $ mkdir -p pesel/src$ touch pesel/README$ touch pesel/src/pesel.rbpeselpesel/READMEpesel/srcpesel/src/pesel.rb
  11. 11. -
  12. 12. $ git initpeselpesel/READMEpesel/srcpesel/src/pesel.rbpesel/.git
  13. 13. 1$ git status# On branch master# Untracked files:# README# src/nothing added to commit butuntracked files present (use gitadd to track)
  14. 14. % $ git add .$ git status# On branch master# Changes to be committed:# new file: README# new file: src/pesel.rb
  15. 15. 0
  16. 16. $ git commit -m Init[master (root-commit) 7b355ec] Init0 files changed, 0 insertions(+), 0deletions(-)create mode 100644 READMEcreate mode 100644 src/pesel.rb$ git status# On branch masternothing to commit (working directory clean)
  17. 17. ! ,
  18. 18. pesel pesel/.git/index pesel/.git 0
  19. 19. 0
  20. 20. 8 02
  21. 21. $ ,($ cd .git/objects finde6/9de29bb2d1d6434b8b29ae775ad8c2e48c539129/206d2658aaf11920998fac41a9f5f7047418fb4b/b2a6cec1e0c51741998cd243367706bbfb3b837b/355ecc8206060071ff60038fa034aab580dd59
  22. 22. .
  23. 23. $ echo Pesel library. README$ git add README$ git commit -m Doc
  24. 24. $ ,($ cd .git/objects finde6/9de29bb2d1d6434b8b29ae775ad8c2e48c539129/206d2658aaf11920998fac41a9f5f7047418fb4b/b2a6cec1e0c51741998cd243367706bbfb3b837b/355ecc8206060071ff60038fa034aab580dd59d3/db0ebf6844ddc3ef19920e753bdf66f332a56550/947a5824bab56cf14775c6594745f5b4409f2f6a/aa7ae7ded1c036bc433a49906733a81da6fc9e
  25. 25. 1: 8; Init Docpesel tree 4bb2a6c 6aaa7aepesel/README blob e69de29 50947a5pesel/src tree 29206d2 29206d2pesel/src/pesel.rb blob e69de29 e69de29
  26. 26. 1 ! Init Doc commit commit 7b355ec d3db0eb tree tree pesel pesel 4bb2a6c 6aaa7ae blob tree blob e69de29 29206d2 50947a5 README src README src/pesel.rb
  27. 27. ,( blob (size)0 tree (size)0 content 100644 blob e69de29 README 040000 tree 29206d2 src Commit (size)0 tag (size)0 tree 6aaa7ae object d3db0eb parent 7b355ec type commit author Piotr Macuk tag v0.0.1 piotr@macuk.pl tagger Piotr Macuk 1271161942 +0200 piotr@macuk.pl committer Piotr Macuk Tue Apr 13 17:24:40 2010 piotr@macuk.pl 1271161942 +0200 First tag. Doc
  28. 28. , 9 )=,
  29. 29. ,
  30. 30. (, 2obj = zlib(sha1(header + content))obj = .git/objects/
  31. 31. ) HEAD $ git branch fix23 $ git checkout fix23 master fix23 F D $ git checkout -b fix23 E C $ git branch -d fix23 B A
  32. 32. %
  33. 33. ) , ,! ? !)@)@ ? @
  34. 34. !) ? AB ,( :C 3 ? !)@ ( ! ,
  35. 35. $ git tag v0.0.1$ git tag -a v1.0$ git tag -s v1.0signed$ git tag -l
  36. 36. @ $ cd .git/refs/ find HEAD master fix23 tags/v0.0.1 heads/master F D heads/fix23 E C tag: v0.0.1 B A
  37. 37. !$ git merge fix23 HEAD$ git branch -d fix23 master HEAD G master fix23 F D F D E C E C B B A A
  38. 38. , D
  39. 39. ! HEAD HEAD$ git checkout fix23 master fix23$ git rebase master D2 D2 HEAD C2 C2 master fix23 master F D F F E C E $ git checkout master E $ git merge fix23 $ git branch -d fix23 B B B A A A
  40. 40. : 9 !$ git logcommit d3db0ebf6844ddc3ef19920e753bdf66f332a565Author: Piotr Macuk piotr@macuk.plDate: Tue Apr 13 14:43:39 2010 +0200 Doccommit 7b355ecc8206060071ff60038fa034aab580dd59Author: Piotr Macuk piotr@macuk.plDate: Tue Apr 13 14:32:22 2010 +0200 Init
  41. 41. : 9 !$ git log$ git log -p$ git log file1 file2 dir3$ git log tag..branch$ git log HEAD~10..$ git log -10$ git log --author=fred$ git log --grep=some text$ git log -Ssome code
  42. 42. $ git showcommit d3db0ebf6844ddc3ef19920e753bdf66f332a565Author: Piotr Macuk piotr@macuk.plDate: Tue Apr 13 14:43:39 2010 +0200 Dokumentacjadiff --git a/README b/READMEindex e69de29..50947a5 100644--- a/README+++ b/README@@ -0,0 +1 @@+Pesel library.
  43. 43. (= ! ,
  44. 44. pesel pesel/.git/index pesel/.git git diff git diff HEAD git diff --cached
  45. 45. $ git commit --amend$ git reset --soft$ git reset --hard # UWAGA
  46. 46. E,B,FGAAE;HHIBJKE,FFEEIKFKE,B,:C 35
  47. 47. 5 4IE5 LBB;
  48. 48. MK5 4IENI5 E,B,MIE,B,J,EKK
  49. 49. ()=
  50. 50. O (, )(
  51. 51. $ git clone url dir$ git remote add janek url$ git pull (lub fetch + merge)$ git push
  52. 52. + private private jan ola jan$ git remote add ola file://home/ola/pesel ola$ git remote add jan file://home/jan/pesel $ git pull # bez push! ola$ git branch -a * master remotes/jan/master
  53. 53. () shared private private private private $ git clone --bare pesel pesel.git $ scp -r pesel.git server:~/ $ git remote add shared server:~/pesel.git
  54. 54. public public public public main private private private Opiekun Developer Developer
  55. 55. /() ) )$ git format-patch master~3$ git apply *.patch$ git add …$ git commit
  56. 56. ! ! ! ,
  57. 57. ! 28 ! ,! L ! ! 2L ! !! 2 !
  58. 58. % ! PQR ! PR S! PTR PR 7 P 1 7R ! L P
  59. 59. 5 4R
  60. 60. + 2UQQ!8
  61. 61. 2UQQ!
  62. 62. 2UQQ2!,24
  63. 63. 2UQQ!! 2UQQ!
  64. 64. *
  65. 65. 3 ! UR

×