SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
DVCS
• Visual SourceSafe
• CVS/Subversion/TFS/etc.
• Git/Mercurial/Bazaar/etc.
Why?
•
Subversion, CVS, etc.



•
•
•
    or
•
分布式版本管理
→
分布式版本管理
CVS/SVN/etc.   Git/Mercurial/etc.



  revision         changeset
•   ≠

•   merge

•
分布式版本管理
• Mercurial   SVN
% hg
Mercurial Distributed SCM

basic commands:

 add        add the specified files on the next commit
 annotate   show changeset information by line for each file
 clone      make a copy of an existing repository
 commit     commit the specified files or all outstanding changes
 diff       diff repository (or selected files)
 export     dump the header and diffs for one or more changesets
 forget     forget the specified files on the next commit
 init       create a new repository in the given directory
 log        show revision history of entire repository or files
 merge      merge working directory with another revision
 pull       pull changes from the specified source
 push       push changes to the specified destination
 remove     remove the specified files on the next commit
 serve      start stand-alone webserver
 status     show changed files in the working directory
 summary    summarize working directory state
 update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
% pwd
/Users/neo/Code/Repo/hginit

% ll
total 24
drwxr-xr-x  5 neo   staff      170   Aug 7 13:13 .
drwxr-xr-x 12 neo   staff      408   Aug 7 13:11 ..
-rw-r--r--@ 1 neo   staff     1605   Jun 26 12:23 Info.plist
-rw-r--r--@ 1 neo   staff     2907   Jun 19 16:18 global.html
-rw-r--r--  1 neo   staff     1183   Jun 12 16:22 link.png

% hg init

% ll
total 24
drwxr-xr-x  6 neo   staff      204   Aug 7 13:14 .
drwxr-xr-x 12 neo   staff      408   Aug 7 13:11 ..
drwxr-xr-x  5 neo   staff      170   Aug 7 13:14 .hg
-rw-r--r--@ 1 neo   staff     1605   Jun 26 12:23 Info.plist
-rw-r--r--@ 1 neo   staff     2907   Jun 19 16:18 global.html
-rw-r--r--  1 neo   staff     1183   Jun 12 16:22 link.png
% hg add
      adding Info.plist
      adding global.html
      adding link.png

      % hg commit




                                     % hg log
                                     changeset:     0:0ae94e57c184
% hg commit
                                     tag:           tip
Info.plist
                                     user:          "Neo Lee <neo.lee at gmail.com>"
global.html
                                     date:          Sat Aug 07 14:43:24 2010 +0800
link.png
                                     files:         Info.plist global.html link.png
committed changeset 0:0ae94e57c184
                                     description:
                                     Init commit.
分布式版本管理
% hg commit




% hg log
changeset:   1:dc12cb350527
tag:         tip
user:        "Neo Lee <neo.lee at gmail.com>"
date:        Sat Aug 07 14:54:57 2010 +0800
files:       global.html
description:
Capitalize 'ERROR' prompt.



changeset:     0:0ae94e57c184
user:          "Neo Lee <neo.lee at gmail.com>"
date:          Sat Aug 07 14:43:24 2010 +0800
files:         Info.plist global.html link.png
description:
Init commit.
% rm Info.plist
% rm link.png




% e global.html
%




% hg revert --all
reverting Info.plist
reverting link.png
reverting global.html
1.
2.
3.         commit
4.          revert
5.   (1)
% cp Info.plist Info.plist.1
% e Info.plist
% rm link.png
remove link.png? y

%   hg status
M   Info.plist
!   link.png
?   Info.plist.1

% hg diff Info.plist
diff -r dc12cb350527 Info.plist
--- a/Info.plist         Sat Aug 07 14:54:57 2010 +0800
+++ b/Info.plist         Sat Aug 07 15:07:18 2010 +0800
@@ -3,7 +3,7 @@
  <plist version="1.0">
  <dict>
         <key>Author</key>
-        <string>Neo Lee</string>
+        <string>Li Jun</string>
         <key>CFBundleDisplayName</key>
         <string>Goo.gl</string>
         <key>CFBundleIdentifier</key>
% hg log
                       changeset:   2:5ba69dac6378
                       tag:         tip
                       user:        "Neo Lee <neo.lee at gmail.com>"
% hg remove link.png
                       date:        Sat Aug 07 15:10:02 2010 +0800
removing link.png
                       files:       Info.plist Info.plist.1 link.png
                       description:
%   hg status
                       Some dirty work!
M   Info.plist
R   link.png
?   Info.plist.1
                       changeset:   1:dc12cb350527
                       user:        "Neo Lee <neo.lee at gmail.com>"
% hg add
                       date:        Sat Aug 07 14:54:57 2010 +0800
adding Info.plist.1
                       files:       global.html
                       description:
%   hg st
                       Capitalize 'ERROR' prompt.
M   Info.plist
A   Info.plist.1
R   link.png
                       changeset:     0:0ae94e57c184
                       user:          "Neo Lee <neo.lee at gmail.com>"
% hg commit
                       date:          Sat Aug 07 14:43:24 2010 +0800
                       files:         Info.plist global.html link.png
                       description:
                       Init commit.
% hg cat Info.plist


% hg cat -r 0 Info.plist


% hg diff -r 0:1 Info.plist


% hg update -r 0


% hg up -r 1


% hg up
分布式版本管理
% mkdir repo

% cd repo

% hg init

% hg serve
listening at http://8.oasis.local:8000/ (bound to *:8000)
% hg clone http://8.oasis.local:8000/ working
no changes found
updating to branch default
resolving manifests
0 files updated, 0 files merged, 0 files removed, 0 files unresolved


% cd working


% ll
total 0
drwxr-xr-x     3 neo   staff   102 Aug   7 15:49 .
drwxr-xr-x     4 neo   staff   136 Aug   7 15:49 ..
drwxr-xr-x     8 neo   staff   272 Aug   7 15:49 .hg
% hg push

Joel   pushing to http://8.oasis.local:8000/
       searching for changes
       adding changesets
       adding manifests
       adding file changes
       added 2 changesets with 2 changes to 1 files
分布式版本管理
Rose
% hg outgoing
       comparing with http://8.oasis.local:8000/
       searching for changes
       changeset:    2:689026657682
       tag:          tip
       user:         Rose M <rose@snda.com>
       date:         Mon Feb 08 15:29:09 2010 -0500

Rose   summary:      Spicier kind of chile.

       % hg push
       pushing to http://8.oasis.local:8000/
       searching for changes
       adding changesets
       adding manifests
       adding file changes
       added 1 changesets with 1 changes to 1 files
% hg outgoing
       comparing with http://8.oasis.local:8000/
       searching for changes
       changeset:    2:4ecdb2401ab4
       tag:          tip
       user:         Joel S <joel@snda.com>
       date:         Mon Feb 08 15:32:01 2010 -0500
       summary:      potato chips. No one can eat just one.
       % hg push
       pushing to http://8.oasis.local:8000/
       searching for changes
       abort: push creates new remote heads!
       (did you forget to merge? use push -f to force)


       % hg incoming

Joel   comparing with http://8.oasis.local:8000/
       searching for changes
       changeset:    3:689026657682
       tag:          tip
       parent:       1:a52881ed530d
       user:         Rose M <rose@example.com>
       date:         Mon Feb 08 15:29:09 2010 -0500
       summary:      spicier kind of chile
       % hg pull
       pulling from http://8.oasis.local:8000/
       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)
% hg merge
       merging guac
       0 files updated, 1 files merged, 0 files removed, 0
       files unresolved
       (branch merge, don't forget to commit)
       % hg commit -m "merge"
       % hg log
       changeset:   4:0849ca96c304
       tag:         tip
       parent:      2:4ecdb2401ab4
       parent:      3:689026657682
       user:        Joel S <joel@snda.com>
       date:        Mon Feb 08 16:07:23 2010 -0500
       summary:     merge

Joel   ... ...
       % hg out
       comparing with http://8.oasis.local:8000//
       searching for changes
       changeset:   2:4ecdb2401ab4
       ... ...
       changeset:   4:0849ca96c304
       ... ...
       % hg push
       pushing to http://8.oasis.local:8000/
       searching for changes
       adding changesets
       adding manifests
       adding file changes
       added 2 changesets with 2 changes to 1 files
Rose
  % hg pull
  pulling from http://8.oasis.local:8000/
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 1 files
  (run 'hg update' to get a working copy)


  % hg log


  % hg parent
  changeset:    2:689026657682
  user:         Rose H <rose@snda.com>
  date:         Mon Feb 08 15:29:09 2010 -0500
  summary:      spicier kind of chile


  % hg up
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
•
    •                 hg revert

    •                 hg rollback    commit pull


•
    •   hg clone project peoject-experiment
分布式版本管理
Backout
  % hg backout -m 'back out second change' tip

  % hg backout --merge -m 'Back out second change.' 1
  reverting myfile
  created new head
  changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a
  merging with changeset 3:abc7fd860049
  merging myfile
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)




1st change              2nd change                3rd change
                                                                         Automated
                                                                           merge
                                                 Back-out 2nd
                                                   change
•   code base

•           pull

•         push

•         merge

•
分布式版本管理
分布式版本管理
分布式版本管理
分布式版本管理
•
•   “   ”

•
•
Subversion → Mercurial/Git?



•
•    /
References

• Mercurial: The Definitive Guide
  by Bryan O'Sullivan, http://hgbook.red-bean.com/


• Hg Init: a Mercurial tutorial
  by Joel Spolsky, http://hginit.com/top/index.html


• Git for the Lazy
  by Spheriki, http://www.spheredev.org/wiki/Git_for_the_lazy


• PeepCode Git Internals
  by Scott Chacon
Contact Me



• neo.lee@gmail.com
• @soulhacker
•
Questions?

Mais conteúdo relacionado

Mais procurados

Assemble Your Code in Stages: Leveling Up With Pipelines
Assemble Your Code in Stages: Leveling Up With PipelinesAssemble Your Code in Stages: Leveling Up With Pipelines
Assemble Your Code in Stages: Leveling Up With PipelinesSteven Wade
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopAll Things Open
 
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developerSpring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developerIván López Martín
 
slides.pdf
slides.pdfslides.pdf
slides.pdfvidsvagi
 
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...Codemotion
 
Centralize your Business Logic with Pipelines in Elixir
Centralize your Business Logic with Pipelines in ElixirCentralize your Business Logic with Pipelines in Elixir
Centralize your Business Logic with Pipelines in ElixirMichael Viveros
 

Mais procurados (10)

Gittalk
GittalkGittalk
Gittalk
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Assemble Your Code in Stages: Leveling Up With Pipelines
Assemble Your Code in Stages: Leveling Up With PipelinesAssemble Your Code in Stages: Leveling Up With Pipelines
Assemble Your Code in Stages: Leveling Up With Pipelines
 
Git github
Git githubGit github
Git github
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
 
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developerSpring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
 
Tool Time
Tool TimeTool Time
Tool Time
 
slides.pdf
slides.pdfslides.pdf
slides.pdf
 
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
Juliette Reinders Folmer - Promote your open source project with GitHub Pages...
 
Centralize your Business Logic with Pipelines in Elixir
Centralize your Business Logic with Pipelines in ElixirCentralize your Business Logic with Pipelines in Elixir
Centralize your Business Logic with Pipelines in Elixir
 

Destaque

Ruby Past, Present, Future
Ruby   Past, Present, FutureRuby   Past, Present, Future
Ruby Past, Present, Futureadamfine
 
Jscex:案例、阻碍、体会、展望
Jscex:案例、阻碍、体会、展望Jscex:案例、阻碍、体会、展望
Jscex:案例、阻碍、体会、展望jeffz
 
Web开发中的缓存
Web开发中的缓存Web开发中的缓存
Web开发中的缓存jeffz
 
JavaScript现代化排错实践
JavaScript现代化排错实践JavaScript现代化排错实践
JavaScript现代化排错实践jeffz
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Insidejeffz
 
大话程序员可用的算法
大话程序员可用的算法大话程序员可用的算法
大话程序员可用的算法jeffz
 
The Evolution of Async Programming (GZ TechParty C#)
The Evolution of Async Programming (GZ TechParty C#)The Evolution of Async Programming (GZ TechParty C#)
The Evolution of Async Programming (GZ TechParty C#)jeffz
 
企业开发领域的语言特性
企业开发领域的语言特性企业开发领域的语言特性
企业开发领域的语言特性jeffz
 
QML 與 C++ 的美麗邂逅
QML 與 C++ 的美麗邂逅QML 與 C++ 的美麗邂逅
QML 與 C++ 的美麗邂逅Jack Yang
 
Rabbit mq簡介(上)
Rabbit mq簡介(上)Rabbit mq簡介(上)
Rabbit mq簡介(上)共和 薛
 
Storm特性
Storm特性Storm特性
Storm特性zyh
 
鐵道女孩向前衝-RubyKaigi心得分享
鐵道女孩向前衝-RubyKaigi心得分享鐵道女孩向前衝-RubyKaigi心得分享
鐵道女孩向前衝-RubyKaigi心得分享Yu-Chen Chen
 
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長International Federation for information integration
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架jeffz
 
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館Taipei Smart City PMO
 
我編譯故我在:誰說 Node.js 程式不能編成 binary
我編譯故我在:誰說 Node.js 程式不能編成 binary我編譯故我在:誰說 Node.js 程式不能編成 binary
我編譯故我在:誰說 Node.js 程式不能編成 binaryFred Chien
 
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長International Federation for information integration
 
Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Fred Chien
 
基于原型的JavaScript面向对象编程
基于原型的JavaScript面向对象编程基于原型的JavaScript面向对象编程
基于原型的JavaScript面向对象编程zhangdaiping
 
計概:Programming Paradigm
計概:Programming Paradigm計概:Programming Paradigm
計概:Programming ParadigmRex Yuan
 

Destaque (20)

Ruby Past, Present, Future
Ruby   Past, Present, FutureRuby   Past, Present, Future
Ruby Past, Present, Future
 
Jscex:案例、阻碍、体会、展望
Jscex:案例、阻碍、体会、展望Jscex:案例、阻碍、体会、展望
Jscex:案例、阻碍、体会、展望
 
Web开发中的缓存
Web开发中的缓存Web开发中的缓存
Web开发中的缓存
 
JavaScript现代化排错实践
JavaScript现代化排错实践JavaScript现代化排错实践
JavaScript现代化排错实践
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
大话程序员可用的算法
大话程序员可用的算法大话程序员可用的算法
大话程序员可用的算法
 
The Evolution of Async Programming (GZ TechParty C#)
The Evolution of Async Programming (GZ TechParty C#)The Evolution of Async Programming (GZ TechParty C#)
The Evolution of Async Programming (GZ TechParty C#)
 
企业开发领域的语言特性
企业开发领域的语言特性企业开发领域的语言特性
企业开发领域的语言特性
 
QML 與 C++ 的美麗邂逅
QML 與 C++ 的美麗邂逅QML 與 C++ 的美麗邂逅
QML 與 C++ 的美麗邂逅
 
Rabbit mq簡介(上)
Rabbit mq簡介(上)Rabbit mq簡介(上)
Rabbit mq簡介(上)
 
Storm特性
Storm特性Storm特性
Storm特性
 
鐵道女孩向前衝-RubyKaigi心得分享
鐵道女孩向前衝-RubyKaigi心得分享鐵道女孩向前衝-RubyKaigi心得分享
鐵道女孩向前衝-RubyKaigi心得分享
 
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長
LWC15 典藏數位化-張其昀先生相關資料數位化之應用 報告人:中國文化大學圖書館 吳瑞秀館長
 
使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架使用.NET构建轻量级分布式框架
使用.NET构建轻量级分布式框架
 
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館
臺北智慧城市專案辦公室公共住宅智慧社區服務說明書工作會議--智慧圖書館
 
我編譯故我在:誰說 Node.js 程式不能編成 binary
我編譯故我在:誰說 Node.js 程式不能編成 binary我編譯故我在:誰說 Node.js 程式不能編成 binary
我編譯故我在:誰說 Node.js 程式不能編成 binary
 
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長
LWC14夢醒時分:圖書館建築構想書的實踐成果 以國立臺東大學圖書館為例。報告人:國立臺東大學圖書館 吳錦範組長
 
Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險Brig:Node.js + QML 華麗大冒險
Brig:Node.js + QML 華麗大冒險
 
基于原型的JavaScript面向对象编程
基于原型的JavaScript面向对象编程基于原型的JavaScript面向对象编程
基于原型的JavaScript面向对象编程
 
計概:Programming Paradigm
計概:Programming Paradigm計概:Programming Paradigm
計概:Programming Paradigm
 

Semelhante a 分布式版本管理

Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-itAutomat-IT
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with gitKarin Taliga
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byJeff Squyres
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notesSurabhi Gupta
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Celestine Omin
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)bryanbibat
 
Getting Into Git
Getting Into GitGetting Into Git
Getting Into GitRick Umali
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroductionBruno Bossola
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Git Acquainted
Git AcquaintedGit Acquainted
Git Acquaintedtylerhunt
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How tolanhuonga3
 

Semelhante a 分布式版本管理 (20)

Git vs. Mercurial
Git vs. MercurialGit vs. Mercurial
Git vs. Mercurial
 
Mercurial
MercurialMercurial
Mercurial
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-by
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?Lagos GitHub Meetup - What is Git?
Lagos GitHub Meetup - What is Git?
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Getting Into Git
Getting Into GitGetting Into Git
Getting Into Git
 
Git - (a) Gentle InTroduction
Git - (a) Gentle InTroductionGit - (a) Gentle InTroduction
Git - (a) Gentle InTroduction
 
Working with Git
Working with GitWorking with Git
Working with Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
 
Git Acquainted
Git AcquaintedGit Acquainted
Git Acquainted
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 

Mais de jeffz

Wind.js无障碍调试与排错
Wind.js无障碍调试与排错Wind.js无障碍调试与排错
Wind.js无障碍调试与排错jeffz
 
Jscex:案例、经验、阻碍、展望
Jscex:案例、经验、阻碍、展望Jscex:案例、经验、阻碍、展望
Jscex:案例、经验、阻碍、展望jeffz
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscexjeffz
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developersjeffz
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programmingjeffz
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)jeffz
 
Jscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptJscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptjeffz
 
单点登录解决方案的架构与实现
单点登录解决方案的架构与实现单点登录解决方案的架构与实现
单点登录解决方案的架构与实现jeffz
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程jeffz
 
Windows Phone应用开发心得
Windows Phone应用开发心得Windows Phone应用开发心得
Windows Phone应用开发心得jeffz
 
针对iPad平台的高性能网站架构
针对iPad平台的高性能网站架构针对iPad平台的高性能网站架构
针对iPad平台的高性能网站架构jeffz
 
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)jeffz
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)jeffz
 
The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)jeffz
 
面向对象与生活
面向对象与生活面向对象与生活
面向对象与生活jeffz
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍jeffz
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架jeffz
 
F#语言对异步程序设计的支持
F#语言对异步程序设计的支持F#语言对异步程序设计的支持
F#语言对异步程序设计的支持jeffz
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路jeffz
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Lifejeffz
 

Mais de jeffz (20)

Wind.js无障碍调试与排错
Wind.js无障碍调试与排错Wind.js无障碍调试与排错
Wind.js无障碍调试与排错
 
Jscex:案例、经验、阻碍、展望
Jscex:案例、经验、阻碍、展望Jscex:案例、经验、阻碍、展望
Jscex:案例、经验、阻碍、展望
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscex
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developers
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programming
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)
 
Jscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptJscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScript
 
单点登录解决方案的架构与实现
单点登录解决方案的架构与实现单点登录解决方案的架构与实现
单点登录解决方案的架构与实现
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程
 
Windows Phone应用开发心得
Windows Phone应用开发心得Windows Phone应用开发心得
Windows Phone应用开发心得
 
针对iPad平台的高性能网站架构
针对iPad平台的高性能网站架构针对iPad平台的高性能网站架构
针对iPad平台的高性能网站架构
 
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)
 
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)The Evolution of Async-Programming on .NET Platform (.Net China, C#)
The Evolution of Async-Programming on .NET Platform (.Net China, C#)
 
The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)The Evolution of Async-Programming (SD 2.0, JavaScript)
The Evolution of Async-Programming (SD 2.0, JavaScript)
 
面向对象与生活
面向对象与生活面向对象与生活
面向对象与生活
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架
 
F#语言对异步程序设计的支持
F#语言对异步程序设计的支持F#语言对异步程序设计的支持
F#语言对异步程序设计的支持
 
大众点评网的技术变迁之路
大众点评网的技术变迁之路大众点评网的技术变迁之路
大众点评网的技术变迁之路
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Life
 

Último

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 

Último (20)

Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 

分布式版本管理

  • 2. • Visual SourceSafe • CVS/Subversion/TFS/etc. • Git/Mercurial/Bazaar/etc.
  • 4.
  • 6. or •
  • 8.
  • 10. CVS/SVN/etc. Git/Mercurial/etc. revision changeset
  • 11. ≠ • merge •
  • 14. % hg Mercurial Distributed SCM basic commands: add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository commit commit the specified files or all outstanding changes diff diff repository (or selected files) export dump the header and diffs for one or more changesets forget forget the specified files on the next commit init create a new repository in the given directory log show revision history of entire repository or files merge merge working directory with another revision pull pull changes from the specified source push push changes to the specified destination remove remove the specified files on the next commit serve start stand-alone webserver status show changed files in the working directory summary summarize working directory state update update working directory (or switch revisions) use "hg help" for the full list of commands or "hg -v" for details
  • 15. % pwd /Users/neo/Code/Repo/hginit % ll total 24 drwxr-xr-x 5 neo staff 170 Aug 7 13:13 . drwxr-xr-x 12 neo staff 408 Aug 7 13:11 .. -rw-r--r--@ 1 neo staff 1605 Jun 26 12:23 Info.plist -rw-r--r--@ 1 neo staff 2907 Jun 19 16:18 global.html -rw-r--r-- 1 neo staff 1183 Jun 12 16:22 link.png % hg init % ll total 24 drwxr-xr-x 6 neo staff 204 Aug 7 13:14 . drwxr-xr-x 12 neo staff 408 Aug 7 13:11 .. drwxr-xr-x 5 neo staff 170 Aug 7 13:14 .hg -rw-r--r--@ 1 neo staff 1605 Jun 26 12:23 Info.plist -rw-r--r--@ 1 neo staff 2907 Jun 19 16:18 global.html -rw-r--r-- 1 neo staff 1183 Jun 12 16:22 link.png
  • 16. % hg add adding Info.plist adding global.html adding link.png % hg commit % hg log changeset: 0:0ae94e57c184 % hg commit tag: tip Info.plist user: "Neo Lee <neo.lee at gmail.com>" global.html date: Sat Aug 07 14:43:24 2010 +0800 link.png files: Info.plist global.html link.png committed changeset 0:0ae94e57c184 description: Init commit.
  • 18. % hg commit % hg log changeset: 1:dc12cb350527 tag: tip user: "Neo Lee <neo.lee at gmail.com>" date: Sat Aug 07 14:54:57 2010 +0800 files: global.html description: Capitalize 'ERROR' prompt. changeset: 0:0ae94e57c184 user: "Neo Lee <neo.lee at gmail.com>" date: Sat Aug 07 14:43:24 2010 +0800 files: Info.plist global.html link.png description: Init commit.
  • 19. % rm Info.plist % rm link.png % e global.html % % hg revert --all reverting Info.plist reverting link.png reverting global.html
  • 20. 1. 2. 3. commit 4. revert 5. (1)
  • 21. % cp Info.plist Info.plist.1 % e Info.plist % rm link.png remove link.png? y % hg status M Info.plist ! link.png ? Info.plist.1 % hg diff Info.plist diff -r dc12cb350527 Info.plist --- a/Info.plist Sat Aug 07 14:54:57 2010 +0800 +++ b/Info.plist Sat Aug 07 15:07:18 2010 +0800 @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>Author</key> - <string>Neo Lee</string> + <string>Li Jun</string> <key>CFBundleDisplayName</key> <string>Goo.gl</string> <key>CFBundleIdentifier</key>
  • 22. % hg log changeset: 2:5ba69dac6378 tag: tip user: "Neo Lee <neo.lee at gmail.com>" % hg remove link.png date: Sat Aug 07 15:10:02 2010 +0800 removing link.png files: Info.plist Info.plist.1 link.png description: % hg status Some dirty work! M Info.plist R link.png ? Info.plist.1 changeset: 1:dc12cb350527 user: "Neo Lee <neo.lee at gmail.com>" % hg add date: Sat Aug 07 14:54:57 2010 +0800 adding Info.plist.1 files: global.html description: % hg st Capitalize 'ERROR' prompt. M Info.plist A Info.plist.1 R link.png changeset: 0:0ae94e57c184 user: "Neo Lee <neo.lee at gmail.com>" % hg commit date: Sat Aug 07 14:43:24 2010 +0800 files: Info.plist global.html link.png description: Init commit.
  • 23. % hg cat Info.plist % hg cat -r 0 Info.plist % hg diff -r 0:1 Info.plist % hg update -r 0 % hg up -r 1 % hg up
  • 25. % mkdir repo % cd repo % hg init % hg serve listening at http://8.oasis.local:8000/ (bound to *:8000)
  • 26. % hg clone http://8.oasis.local:8000/ working no changes found updating to branch default resolving manifests 0 files updated, 0 files merged, 0 files removed, 0 files unresolved % cd working % ll total 0 drwxr-xr-x 3 neo staff 102 Aug 7 15:49 . drwxr-xr-x 4 neo staff 136 Aug 7 15:49 .. drwxr-xr-x 8 neo staff 272 Aug 7 15:49 .hg
  • 27. % hg push Joel pushing to http://8.oasis.local:8000/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files
  • 29. Rose
  • 30. % hg outgoing comparing with http://8.oasis.local:8000/ searching for changes changeset: 2:689026657682 tag: tip user: Rose M <rose@snda.com> date: Mon Feb 08 15:29:09 2010 -0500 Rose summary: Spicier kind of chile. % hg push pushing to http://8.oasis.local:8000/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files
  • 31. % hg outgoing comparing with http://8.oasis.local:8000/ searching for changes changeset: 2:4ecdb2401ab4 tag: tip user: Joel S <joel@snda.com> date: Mon Feb 08 15:32:01 2010 -0500 summary: potato chips. No one can eat just one. % hg push pushing to http://8.oasis.local:8000/ searching for changes abort: push creates new remote heads! (did you forget to merge? use push -f to force) % hg incoming Joel comparing with http://8.oasis.local:8000/ searching for changes changeset: 3:689026657682 tag: tip parent: 1:a52881ed530d user: Rose M <rose@example.com> date: Mon Feb 08 15:29:09 2010 -0500 summary: spicier kind of chile % hg pull pulling from http://8.oasis.local:8000/ 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)
  • 32. % hg merge merging guac 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) % hg commit -m "merge" % hg log changeset: 4:0849ca96c304 tag: tip parent: 2:4ecdb2401ab4 parent: 3:689026657682 user: Joel S <joel@snda.com> date: Mon Feb 08 16:07:23 2010 -0500 summary: merge Joel ... ... % hg out comparing with http://8.oasis.local:8000// searching for changes changeset: 2:4ecdb2401ab4 ... ... changeset: 4:0849ca96c304 ... ... % hg push pushing to http://8.oasis.local:8000/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files
  • 33. Rose % hg pull pulling from http://8.oasis.local:8000/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files (run 'hg update' to get a working copy) % hg log % hg parent changeset: 2:689026657682 user: Rose H <rose@snda.com> date: Mon Feb 08 15:29:09 2010 -0500 summary: spicier kind of chile % hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  • 34. • hg revert • hg rollback commit pull • • hg clone project peoject-experiment
  • 36. Backout % hg backout -m 'back out second change' tip % hg backout --merge -m 'Back out second change.' 1 reverting myfile created new head changeset 3:abc7fd860049 backs out changeset 1:7e341ee3be7a merging with changeset 3:abc7fd860049 merging myfile 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) 1st change 2nd change 3rd change Automated merge Back-out 2nd change
  • 37. code base • pull • push • merge •
  • 42. • • “ ” • •
  • 44. References • Mercurial: The Definitive Guide by Bryan O'Sullivan, http://hgbook.red-bean.com/ • Hg Init: a Mercurial tutorial by Joel Spolsky, http://hginit.com/top/index.html • Git for the Lazy by Spheriki, http://www.spheredev.org/wiki/Git_for_the_lazy • PeepCode Git Internals by Scott Chacon