用远程文件替换本地文件

时间:2012-07-04 09:03:44

标签: version-control mercurial

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

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

2 个答案:

答案 0 :(得分:2)

hg update -Chg revert都将执行您要查找的内容 - 将本地修改的文件替换为存储库中的干净版本。我个人更喜欢hg revert,但hg up -C也会选择

hg revert

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.

希望有所帮助

克里斯

答案 1 :(得分:0)

svn update?

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

或者尝试选择--force。