hg

2020-01-23 16:11 阅读 1,229 views 次 hg已关闭评论

合并一个文件夹的变动到当前文件夹

hg pull  anotherDir

然后在vscode打开本文件夹,SC界面选择merge,选择新的分支。

这样比 hg update快。

 

查看改动:

hg diff 

放弃变更并重新开始:

hg revert hello.c 或者用--all选项来恢复所有文件 

list changesets in draft or secret phase:

hg log -r "not public()"

hg serve
http://127.0.0.1:8000

hg diff -r 4da991f748ed -r tip

hg status
hg diff
hg commit -m 'gf solve python problem'

我想要看看这一版都改动了那些地方怎么查?记得git中用show命令。hg呢?export就好了:

Working in a named branch

Create the branch

$ hg branch feature1
(do some changes)
$ hg commit
(write commit message)
commit一个后branch才会存在

Update into the branch and work in it

$ hg update feature1
(do some changes)
$ hg commit
(write commit message)

Now you can commit, pull, push and merge (and anything else) as if you were working in a separate repository. If the history of the named branch is linear and you call "hg merge", Mercurial asks you to specify an explicit revision, since the branch in which you work doesn't have anything to merge.
Merge the named branch

When you finished the feature, you merge the branch back into the default branch.

$ hg update default
$ hg merge feature1
$ hg commit
(write commit message)

To see the active branches with hg branches. To mark a branch as inactive, for example because you finished implementing the feature, you can close it. Closed branches are hidden in hg branches as well as in hg heads.

$ hg update feature1
$ hg commit --close-branch -m "finished feature1"

Add the tag

$ hg tag -r 3 v0.1

 

https://www.mercurial-scm.org/guide

版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:hg | 文档
分类:电脑技术 标签:

评论已关闭!