Mercurial - 为什么 diff 不起作用?

发布于 2024-12-06 00:31:43 字数 175 浏览 2 评论 0原文

我刚刚开始使用 Mercurial(适用于 Windows)。根据教程 http://hginit.com/01.html 我制作了存储库等。但是 diff命令不显示我在文件中所做的任何更改。您知道哪里出了问题吗? 提前致谢!

I have just started to use mercurial (for windows). According to the tutorial http://hginit.com/01.html I made repository, etc. But diff command doesn't show any changes that I made in files. Do you have any ideas what is wrong?
Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

思念绕指尖 2024-12-13 00:31:43

默认情况下,如果命令 hg diff 将显示工作目录与其父目录之间的差异。正如 nye17 所建议的,如果您在运行 hg diff 之前提交了一些更改,那么工作目录将与其父目录相同,并且不显示任何输出。在这些情况下,您可以通过运行 hg diff -c -1 来查看所做的更改。这将对之前的 (-1) 变更集运行 hg diff 命令。

By default, if the command hg diff will show differences between the working directory, and its parent. As nye17 suggested, if you have committed some changes just prior to running hg diff then the working directory will be the same as its parent, and show no output. In these instances, you can see what changes were made in by running hg diff -c -1. This will run the hg diff command on the previous (-1) changeset.

风吹过旳痕迹 2024-12-13 00:31:43

基本步骤如下:

hg init .       ---- This make the current directory as blank hg repository

echo "XYZ" > test.txt   --- This creates a new file which is not added to version control yet.

hg add test.txt --- The file is added to repo for commit

hg commit test.txt -m "added file test.txt"  --- Now you can commit the file

hg log  ----- to see the log

hg diff test.txt ----- will show no diff as the latest file committed is same

echo "TTTT" >> test.txt   ----- make some changes

hg diff test.txt   -------- should show the difference of current file to latest in commit

hg commit test.txt -m "second commit"  ----- now once you have committed, latest in repo and working directory is same

hg diff test.txt ------ this diff should again be blank

Basic steps are as follows:

hg init .       ---- This make the current directory as blank hg repository

echo "XYZ" > test.txt   --- This creates a new file which is not added to version control yet.

hg add test.txt --- The file is added to repo for commit

hg commit test.txt -m "added file test.txt"  --- Now you can commit the file

hg log  ----- to see the log

hg diff test.txt ----- will show no diff as the latest file committed is same

echo "TTTT" >> test.txt   ----- make some changes

hg diff test.txt   -------- should show the difference of current file to latest in commit

hg commit test.txt -m "second commit"  ----- now once you have committed, latest in repo and working directory is same

hg diff test.txt ------ this diff should again be blank
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文