Hg 常用命令

Mercurial Commands

https://gist.github.com/cortesben/016cd401faae5a8dae59

CommandsDescription
hg pullget latest changes like git pull use flags like -u IDK why yet
hg addonly for new files
hg commitadd changes to commit with -m for message just like git
hg addremoveadds new files and removes file not in your file system
hg incomingsee changes commited by others
hg outgoingsee local commits
hg commit --amendsame as git commit --amend
hg record filenameshows history of changes to file uses extension
hg mergelike a git mergehttp://hgbook.red-bean.com/read/a-tour-of-mercurial-merging-work.html
hg log -r tiptip changelog
hg log -l 5last 5 changelog statuses
hg status -mshow modified files only
hg status -rshow removed files only
hg status -ashow added files only
hg strip “0000”remove commit from history and delete changes before push, if pushed you are fucked
hg log -u email@accout.comsee all account commits | type -v for a verbose version
hg diff -r 0000:0000 /dir/location/pathDiff versions of same file from different CHANGESET
hg diff | less; hg commitshow changes committed
hg outSee what is not pushed to remote branch
hg update 0000CHANGESET = 0000 or branchname
hg checkout branchworks like a git checkout branch
hg recordshows record of pending changes
hg update -Cresets your head and removes commits not pushed like git reset --hard
hg backout 0000CHANGESET = 0000 like a git revert tag/hash
hg blame or hg annotatesame as a git blame
hg bisectlets you test inbetween commits to find bugs http://mercurial.selenic.com/wiki/BisectExtension
hg shelvelike a git stash(Requires the ShelveExtension or the AtticExtension.)
hg graft --edit 0000lets you pick what changes to push to default or commit CHANGESET = 0000 git cherry-pick <commit>http://selenic.com/hg/help/graft
hg graft --edit 0000::0005add a series of commits from 0000 to 0005 as a batch
hg headsshows changes in child and parent branches
hg identify --numcurrent changeset
hg branch featurego to default branch and use this command to create a new branch namded “feature” based off of it
hg commit --close-branch -m ‘closing this branch’Inside branch you want to close commit this and push so branch disapears and keeps your coworkers happy
noteHg .hgignore, syntax: glob is the same behaviour as git’s .gitignore.

Branching

http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值