A Guide to Branching in Mercurial
来源:互联网 发布:mysql share mode 编辑:程序博客网 时间:2024/05/22 17:25
原文地址:http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
Branching with Named Branches
The third way of branching is to use Mercurial’s named branches. Some people prefer this method (myself included) and many others don’t.
To create a new named branch:
$ cd ~/src/test-project$ hg branch feature
When you commit the newly created changeset will be on the same branch as its parent, unless you’ve usedhg branch
to mark it as being on a different one.
Using a branch name to specify a revision is shorthand for “the tip changeset of this named branch”. In this example repository:
- Running
hg update default
would update to changeset 3, which is the tip of thedefault
branch. - Running
hg update feature
would update to changeset 4, which is the tip of thefeature
branch.
In the past there was also the problem of not having a way to “close” a branch, which means that over time the list of branches could get huge. This was fixed in Mercurial 1.2 which introduced the--close-branch
option forhg commit
.
Mercurial will push/pull all branches by default, while git will push/pull only thecurrent branch.
This is important if you’re a git user working with Mercurial. If you want to push/pull only a single branch with Mercurial you can use the--rev
option (-r
for short) and specify the tip revision of the branch:
$ hg push --rev branchname$ hg push --rev bookmarkname$ hg push --rev 4
If you specify a revision, Mercurial will push that changeset and any ancestors of it that the target doesn’t already have.
- A Guide to Branching in Mercurial
- A Complete Guide to Programming in C++
- A guide to Java SimpleDateFormat in examples
- A guide to Java SimpleDateFormat in examples
- A guide to object cloning in java
- A Programmers Guide to ADO.NET in C#
- A field guide to Zones in OpenSolaris 2008.05
- Persistence in the Enterprise: A Guide to Persistence Technologies
- A GENTLE GUIDE TO USING BATCH NORMALIZATION IN TENSORFLOW
- A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linux
- Apache Tutorial: Enable mod_rewrite In Windows A brief action guide to enable mod_rewrite in Windows
- linux_A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linu
- A Professional's Guide To Data Communication In a TCP/IP World
- UsingOAuthConsumer - A developer's guide to using OAuthConsumer in a Mac application
- How to fix "Case folding collision" in Mercurial
- A guide to keyword analysis
- A Guide to use SSL
- A working guide to kestrel
- IOS开发之CocoaAsyncSocket学习
- linux命令终极系列之(find与xargs)
- awk实用功能
- iphone开发之多线程NSThread和NSInvocationOperation
- VIM之分割窗口操作
- A Guide to Branching in Mercurial
- Struts 2 工作原理
- 如何在发布包中将资源放在独立目录中
- 弹出IE下载框提供下载的方法
- gdb调试
- 文字超长自动省略,以...代替,CSS实现
- VC选择文件夹对话框,updata(false)应该是对话框的功能,而不是控件的功能
- PowerBuilder小知识点
- java中使用json1