我刚开始使用mercurial(用于windows)。根据教程http://hginit.com/01.html我做了存储库等,但diff命令不显示我在文件中所做的任何更改。你有什么想法是什么错误? 在此先感谢!Mercurial - 为什么不区分工作?
0
A
回答
2
默认情况下,如果命令hg diff
将显示工作目录,与其父之间的差异。正如nye17所建议的那样,如果在运行hg diff
之前已经做了一些更改,那么工作目录将与其父目录相同,并且不显示输出。在这些情况下,您可以通过运行hg diff -c -1
来查看进行了哪些更改。这将在先前的(-1
)变更集上运行hg diff命令。
2
基本步骤如下:
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
相关问题
- 1. 禁用负载分区不工作为什么?
- 2. 为什么这个分区不能在Python中工作?
- 3. 为什么位置部分不工作?
- 4. 为什么不dajax分配工作?
- 5. 为什么Array.push.apply不工作?
- 6. printf不工作为什么?
- 7. 为什么socket.sendall()不工作?
- 8. countDownTimer不工作,为什么?
- 9. 为什么不工作notifyItemChanged
- 10. 为什么nspredicate不工作
- 11. 为什么the_author()不工作
- 12. 为什么navigationItem.titleView不工作?
- 13. 为什么AlarmMAnager不工作?
- 14. 这为什么不工作?
- 15. 为什么Zend_Route不工作?
- 16. 为什么不工作
- 17. 为什么.data不工作?
- 18. 为什么不工作
- 19. 为什么不FetchType.Lazy工作?
- 20. 为什么jquery不工作
- 21. 为什么不工作
- 22. 为什么不translit工作?
- 23. 为什么不工作wsdl.exe?
- 24. 为什么scrollTop不工作?
- 25. 为什么不工作
- 26. 为什么不工作
- 27. 为什么DOMXPath不工作?
- 28. 为什么不“chrome.bookmarks.getTree”工作?
- 29. 为什么history.pushState不工作?
- 30. 为什么json_encode不工作?
如果您想允许我们提供帮助,您必须提供您使用的命令行和结果。 – Klaim
在做'hg diff'之前你做过'hg commit'吗?如果是这样,则不会显示任何更改。 – nye17