Skip to content

dongliang3571/Mercurial-Notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Mercurial-Notes

Mercurial Commands

Switch branch

hg update <branch-name>

to clean all current changes while switching branches

hg update -C|--clean <branch-name>

update to a specific revision

hg update -r|--rev <revision>

Show branch name

current branch name

hg branch

list all branches

hg branches

# show closed branches too
hg branches -c|--closed

Close a branch

hg commit --close-branch

Create a branch

hg branch <branch-name>

Push new branch to remote

hg push -b <branch-name> --new-branch

revert changesets without removing commits

hg revert --all -r <parent of rev-to-revert>

revert by creating a new head

hg update -r <rev-to-revert>
# this is similar to git checkout <commit-hash>

Check logs

all logs from all branches

hg log

logs for a specified branch

hg log -b <branch-name>

limit number of logs to be displayed

hg log -b <branch-name> -l <a-number>

Do stuff in a sub repo

hg -R <subrepo> <commands>

Check identity the working directory or specified revision

current directory with current revision

hg id

# output: f8df3081b002 (BETA) tip

current directory with a specific revision

hg id -r|--rev <revision>

a subrepo directory with current revision

hg -R <subrepo> id

get a complete id that is stored in .hgsubstate

hg --debug id

# output: d5ab68e45277f9134562a780a2d0ccc3e07e15ac (Wanaka_EU_Common)

About

Mercurial Commands

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages