1

如何用存储库中的最新版本替换本地文件?

还有一种方法可以替换与存储库中的相应文件冲突的所有本地文件吗?

4

2 回答 2

2

两者都hg update -Chg revert做您正在寻找的 - 用存储库中的干净版本替换本地修改的文件。我个人更喜欢hg reverthg up -C也会做这项工作

汞还原

帮助中的一些进一步细节hg revert

With no revision specified, revert the specified files or directories to
the contents they had in the parent of the working directory. This
restores the contents of files to an unmodified state and unschedules
adds, removes, copies, and renames. If the working directory has two
parents, you must explicitly specify a revision.

Using the -r/--rev or -d/--date options, revert the given files or
directories to their states as of a specific revision. Because revert does
not change the working directory parents, this will cause these files to
appear modified. This can be helpful to "back out" some or all of an
earlier change. See "hg backout" for a related method.

Modified files are saved with a .orig suffix before reverting. To disable
these backups, use --no-backup.

希望有帮助

克里斯

于 2012-07-04T13:49:32.877 回答
0

svn更新?

或者删除你的文件夹,然后 svn checkout...

或尝试选项--force。

于 2012-07-04T09:13:00.250 回答