如何查看即将被推送的提交?
我做了一个本地提交。拉变化。不,它需要合并。我不想合并,想撤消提交、拉取、更新更改,然后再次提交。
我该怎么做,因为rollback
只撤消最后一个拉命令?
这就是 Mercurial 的工作方式,您不应该以直线历史的名义与之抗争,但有一些工具可以编辑历史。启用rebase
扩展并hg rebase
在拉取后运行。在您描述的简单情况下,它将自动将您的本地提交移动到提示。
- How do I view commits that are about to be pushed?
Use hg outgoing
. That shows what hg push
would have sent to the server. The opposite command is hg incoming
, which shows what hg pull
would have retrieved.
- I'd made a local commit. Pull a change. And no it requires a merge. I prefer not to merge and would like to undo the commit, Pull, Update changes, Then commit again.
Like Mark says, you're looking for the rebase extension. Enable it with
[extensions]
rebase =
in your config file and then run
$ hg pull
$ hg rebase
to move your local work (this can be multiple changesets, not just a single as in your work around!) on top of the changesets you just pulled down.
How do I do it since rollback only undo the last command which is pull?
Please don't use hg rollback
as a general undo mechanism. It's a low-level command that should not be used as much as it is, especially not by new users. The rollback command removes the last transaction from the repository — a transaction in Mercurial is typically the last changeset you made or the last changesets (plural) you pulled into the repository.