博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A Guide to Branching in Mercurial
阅读量:4182 次
发布时间:2019-05-26

本文共 1460 字,大约阅读时间需要 4 分钟。

原文地址:

 

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 used hg 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  the default branch.
  • Running hg update feature would update to changeset 4, which is the tip of  the feature 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 the current 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.

 

转载地址:http://xxhai.baihongyu.com/

你可能感兴趣的文章
Android四大组件之Service示例
查看>>
Android四大组件Service之前台进程(201807最新源码)
查看>>
实战Android:用AccessibilityService捕获volume按键
查看>>
实战Android:通过BroadcastReceiver监听Home,电源Power,和音量变化Volume键
查看>>
Android Studio错误:找不资源文件包 -- Cannot resolve symbol "R"
查看>>
实战Android:图片处理之ColorMatrix和Matrix实例
查看>>
Android Bitmap入门:getPixels的正确理解
查看>>
VS2017的怪问题--错误: 未能完成操作。未指定的错误
查看>>
Anaconda闪退的问题AttributeError: 'str' object has no attribute 'get'
查看>>
matplotlib中plot.show()不显示图片的问题:如何把backend=Agg配置为TkAgg
查看>>
ffmpeg截取视频片段命令优化
查看>>
我所理解的设计模式(C++实现)——访问者模式(Visitor Pattern)
查看>>
我所理解的设计模式(C++实现)——策略模式(Strategy Pattern)
查看>>
我所理解的设计模式(C++实现)——状态模式(State Pattern)
查看>>
我所理解的设计模式(C++实现)——备忘录模式(Memento Pattern)
查看>>
ubuntu中使用mysql实现opensips用户认证
查看>>
ubuntu14.04 安装freeswich问题记录
查看>>
编译webrtc audio_device提示的‘typeof’问题
查看>>
音视频文件码率与大小计算
查看>>
语音质量评价
查看>>