Your SlideShare is downloading. ×
DrupalCafe5 VCS
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

DrupalCafe5 VCS

1,385

Published on

Version Control Systems: Mercurial and Git

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,385
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Version Control Systems Yuriy Gerasimov Madcap B.V. [email_address]
  • 2. Centralized VCS
  • 4. Distributed VCS
  • 7. Mercurial
    • hg init
    • 8. hg clone http://hg.serpentine.com/tutorial/hello
    • 9. hg clone repo repo_clone
    • 10. hg clone ssh://user@server//srv/hg/repo
  • 11. Mercurial
  • 16. Mercurial
    • hg commit (hg ci <files> -m ‘message’)
    • 17. hg rollback (rollback last commit)
    • 18. hg update (hg update -C)
    • 19. hg revert -r <rev> --all
    • 20. hg tag
  • 21. Mercurial
    • hg log
    • 22. -l5 – last 5 commits
    • 23. --graph – graph view (-G)
    • 24. --style compact / changelog / <custom>
    • 25. -d’Dec 9’ – date
  • 26. Mercurial
  • 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. Mercurial
  • 32. Mercurial hg merge hg update -C hg merge
    • Wrong conflict resolution
  • 33. Mercurial
    • hg serve
    • 34. localhost:8000
  • 35. Mercurial
  • 38. Mercurial
    • Mistakes
      • Edit file. hg revert (creates .orig file)
      • 39. File management errors (add / remove). hg revert
      • 40. Wrong commit
        • Last commit. hg backout -m ‘message’
        • 41. Not last commit. hg backout --merge -m ‘message’ -<rev>
  • 42. Mercurial
    • Hooks (hgrc file in .hg folder)
    • 43. Meld (hg meld)
    • 44. Fetch (hg fetch)
    [hooks] changegroup = hg update >&2 [extensions] hgext.extdiff = [extdiff] cmd.meld = [extensions] fetch =
  • 45. git
    • git init
    • 46. git clone
    • 47. git add <file> (add file to index, staging area)
    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. git
    • git commit (git commit -a -m)
    • 49. git diff (--cached, --no-prefix)
    • 50. git rm
  • 51. git
    • git log
      • git log -p -2 – add diff to output, only last two
      • 52. git log –pretty=oneline --graph
      • 53. git log --pretty=format:&quot;%h - %an, %ar : %s&quot;
  • 54. git
    • gitk
  • 55. git
    • gitg
  • 56. git
    • git commit --amend – change last commit
    • 57. git reset HEAD <file> – unstage file
    • 58. git checkout -- <file> – unmodify file
  • 59. git
    • git add -i – interactive staging
  • 60. git
    • git stash (git stash apply)
    $ 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. git
  • 65. git
    • git branch (-a)
    • 66. git checkout <branch>
    • 67. git checkout -b <branch>
    • 68. git merge <branch>
    • 69. git branch -d
  • 70. Mercurial
    • Anonymous branches (heads)
    • 71. Named branches
      • hg branch
      • 72. hg update <branch>
    • Bookmarks
  • 73. git
    • Remote branches
      • git fetch origin
      • 74. git push (remote) (branch)
  • 75. Mercurial
    • Mercurial pulls and push all changesets. No matter what branch.
  • 76. git
    • Merge conflict
    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. git
    • mergetool
  • 78. git [extensions] rebase =
  • 81. git
    • Git-serve (https://github.com/jezdez/git-serve)
  • 82. Set up server
    • Mercurial hgweb.cgi
    • 83. git gitweb.cgi
    [collections] /srv/hg = /srv/hg
  • 84. svn git hg
  • 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. Public services
    • hg: bitbucket.org
    • 88. git: github.com
  • 89. Drupal goes git way
    • http://groups.drupal.org/drupal-org-git-migration-team
    • 90. http://git.drupalcode.org/
    • 91. https://github.com/drupal/drupal
  • 92. Resources
    • hg
      • Mercurial: The Definitive Guide
      • 93. http://mercurial.selenic.com/guide/
    • git
      • http://drupal.org/node/783086
    • http://www.proft.com.ua/2010/10/17/spravochnik-po-git-i-mercurial/
  • 94. Version Control Systems Yuriy Gerasimov Madcap B.V. [email_address]

×