Your SlideShare is downloading. ×
0
Version Control Systems Yuriy Gerasimov Madcap B.V. [email_address]
Centralized VCS <ul><li>SVN
CVS </li></ul>
Distributed VCS <ul><li>Mercurial
Git
Bazzar </li></ul>
Mercurial <ul><li>hg init
hg clone  http://hg.serpentine.com/tutorial/hello
hg clone repo repo_clone
hg clone ssh://user@server//srv/hg/repo </li></ul>
Mercurial <ul><li>hg status (hg st)
hg diff
hg add
hg rm
hg addremove </li></ul>
Mercurial <ul><li>hg commit (hg ci <files> -m ‘message’)
hg rollback (rollback last commit)
hg update (hg update -C)
hg revert -r <rev> --all
hg tag </li></ul>
Mercurial <ul><li>hg log
-l5 – last 5 commits
--graph – graph view (-G)
--style compact / changelog / <custom>
-d’Dec 9’ – date </li></ul>
Mercurial <ul><li>hg pull (hg pull -u)
hg push
hg heads
hg merge </li></ul>
Mercurial $  hg pull ../my-hello pulling from ../my-hello searching for changes adding changesets adding manifests adding ...
Mercurial
Mercurial hg merge hg update -C hg merge <ul><li>Wrong conflict resolution </li></ul>
Mercurial <ul><li>hg serve
localhost:8000 </li></ul>
Mercurial <ul><li>.hgignore
hg forget
hg blame </li></ul>
Mercurial <ul><li>Mistakes </li><ul><li>Edit file. hg revert (creates .orig file)
File management errors (add / remove). hg revert
Upcoming SlideShare
Loading in...5
×

DrupalCafe5 VCS

1,400

Published on

Version Control Systems: Mercurial and Git

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,400
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "DrupalCafe5 VCS"

  1. 1. Version Control Systems Yuriy Gerasimov Madcap B.V. [email_address]
  2. 2. Centralized VCS <ul><li>SVN
  3. 3. CVS </li></ul>
  4. 4. Distributed VCS <ul><li>Mercurial
  5. 5. Git
  6. 6. Bazzar </li></ul>
  7. 7. Mercurial <ul><li>hg init
  8. 8. hg clone http://hg.serpentine.com/tutorial/hello
  9. 9. hg clone repo repo_clone
  10. 10. hg clone ssh://user@server//srv/hg/repo </li></ul>
  11. 11. Mercurial <ul><li>hg status (hg st)
  12. 12. hg diff
  13. 13. hg add
  14. 14. hg rm
  15. 15. hg addremove </li></ul>
  16. 16. Mercurial <ul><li>hg commit (hg ci <files> -m ‘message’)
  17. 17. hg rollback (rollback last commit)
  18. 18. hg update (hg update -C)
  19. 19. hg revert -r <rev> --all
  20. 20. hg tag </li></ul>
  21. 21. Mercurial <ul><li>hg log
  22. 22. -l5 – last 5 commits
  23. 23. --graph – graph view (-G)
  24. 24. --style compact / changelog / <custom>
  25. 25. -d’Dec 9’ – date </li></ul>
  26. 26. Mercurial <ul><li>hg pull (hg pull -u)
  27. 27. hg push
  28. 28. hg heads
  29. 29. hg merge </li></ul>
  30. 30. Mercurial $ hg pull ../my-hello pulling from ../my-hello searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge)
  31. 31. Mercurial
  32. 32. Mercurial hg merge hg update -C hg merge <ul><li>Wrong conflict resolution </li></ul>
  33. 33. Mercurial <ul><li>hg serve
  34. 34. localhost:8000 </li></ul>
  35. 35. Mercurial <ul><li>.hgignore
  36. 36. hg forget
  37. 37. hg blame </li></ul>
  38. 38. Mercurial <ul><li>Mistakes </li><ul><li>Edit file. hg revert (creates .orig file)
  39. 39. File management errors (add / remove). hg revert
  40. 40. Wrong commit </li><ul><li>Last commit. hg backout -m ‘message’
  41. 41. Not last commit. hg backout --merge -m ‘message’ -<rev> </li></ul></ul></ul>
  42. 42. Mercurial <ul><li>Hooks (hgrc file in .hg folder)
  43. 43. Meld (hg meld)
  44. 44. Fetch (hg fetch) </li></ul>[hooks] changegroup = hg update >&2 [extensions] hgext.extdiff = [extdiff] cmd.meld = [extensions] fetch =
  45. 45. git <ul><li>git init
  46. 46. git clone
  47. 47. git add <file> (add file to index, staging area) </li></ul>yuriy@dell-desktop:~/gitpresentation/repo1$ git status # On branch master # Changed but not updated: # (use &quot;git add <file>...&quot; to update what will be committed) # (use &quot;git checkout -- <file>...&quot; to discard changes in working directory) # # modified: test.txt # # Untracked files: # (use &quot;git add <file>...&quot; to include in what will be committed) # # README no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
  48. 48. git <ul><li>git commit (git commit -a -m)
  49. 49. git diff (--cached, --no-prefix)
  50. 50. git rm </li></ul>
  51. 51. git <ul><li>git log </li><ul><li>git log -p -2 – add diff to output, only last two
  52. 52. git log –pretty=oneline --graph
  53. 53. git log --pretty=format:&quot;%h - %an, %ar : %s&quot; </li></ul></ul>
  54. 54. git <ul><li>gitk </li></ul>
  55. 55. git <ul><li>gitg </li></ul>
  56. 56. git <ul><li>git commit --amend – change last commit
  57. 57. git reset HEAD <file> – unstage file
  58. 58. git checkout -- <file> – unmodify file </li></ul>
  59. 59. git <ul><li>git add -i – interactive staging </li></ul>
  60. 60. git <ul><li>git stash (git stash apply) </li></ul>$ git stash list stash@{0}: WIP on master: 049d078 added the index file stash@{1}: WIP on master: c264051... Revert &quot;added file_size&quot; stash@{2}: WIP on master: 21d80a5... added number to log
  61. 61. git <ul><li>git rebase -i HEAD~3
  62. 62. edit
  63. 63. squash
  64. 64. reorder </li></ul>
  65. 65. git <ul><li>git branch (-a)
  66. 66. git checkout <branch>
  67. 67. git checkout -b <branch>
  68. 68. git merge <branch>
  69. 69. git branch -d </li></ul>
  70. 70. Mercurial <ul><li>Anonymous branches (heads)
  71. 71. Named branches </li><ul><li>hg branch
  72. 72. hg update <branch> </li></ul><li>Bookmarks </li></ul>
  73. 73. git <ul><li>Remote branches </li><ul><li>git fetch origin
  74. 74. git push (remote) (branch) </li></ul></ul>
  75. 75. Mercurial <ul><li>Mercurial pulls and push all changesets. No matter what branch. </li></ul>
  76. 76. git <ul><li>Merge conflict </li></ul>yuriy@dell-desktop:~/gitpresentation/repo1$ git merge master Auto-merging test.txt CONFLICT (content): Merge conflict in test.txt Automatic merge failed; fix conflicts and then commit the result.n yuriy@dell-desktop:~/gitpresentation/repo1$ cat test.txt hello <<<<<<< HEAD new line conflict ======= master line >>>>>>> master
  77. 77. git <ul><li>mergetool </li></ul>
  78. 78. git <ul><li>git pull
  79. 79. git rebase
  80. 80. hg rebase </li></ul>[extensions] rebase =
  81. 81. git <ul><li>Git-serve (https://github.com/jezdez/git-serve) </li></ul>
  82. 82. Set up server <ul><li>Mercurial hgweb.cgi
  83. 83. git gitweb.cgi </li></ul>[collections] /srv/hg = /srv/hg
  84. 84. svn git hg <ul><li>git-svn
  85. 85. hg-git </li></ul>
  86. 86. Config files .hgrc [ui] username = Yuriy Gerasimov <y.gerasimov@mdacap.nl> style = compact [extensions] hgext.extdiff = hgext.graphlog = fetch = hgext.bookmarks = rebase = hggit = /home/yuriy/programs/hg-git/hggit [git] intree = True [extdiff] cmd.meld = [bookmarks] track.current = True [auth] kiev.prefix = http://kiev.madcap.nl/hg kiev.username = yuriy kiev.password = abcd local.prefix = http://hg.yuriy-desktop local.username = yuriy local.password = abcd .gitconfig [color] ui = auto [color &quot;diff&quot;] meta = yellow bold frag = magenta bold old = red bold new = green bold whitespace = red reverse [core] whitespace=fix,-indent-with-non-tab,-indent-with-tab, trailing-space,cr-at-eol [alias] df = !git diff --no-prefix && git diff --staged --no-prefix clear = reset --hard st = status co = checkout br = branch ci = commit unstage = reset HEAD -- [user] name = Yuriy Gerasimov email = yuri.gerasimov@gmail.com
  87. 87. Public services <ul><li>hg: bitbucket.org
  88. 88. git: github.com </li></ul>
  89. 89. Drupal goes git way <ul><li>http://groups.drupal.org/drupal-org-git-migration-team
  90. 90. http://git.drupalcode.org/
  91. 91. https://github.com/drupal/drupal </li></ul>
  92. 92. Resources <ul><li>hg </li><ul><li>Mercurial: The Definitive Guide
  93. 93. http://mercurial.selenic.com/guide/ </li></ul><li>git </li><ul><li>http://drupal.org/node/783086 </li></ul><li>http://www.proft.com.ua/2010/10/17/spravochnik-po-git-i-mercurial/ </li></ul>
  94. 94. Version Control Systems Yuriy Gerasimov Madcap B.V. [email_address]
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×