我剛開始使用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. 爲什麼這個分區不能在Python中工作?
- 2. 禁用負載分區不工作爲什麼?
- 3. 爲什麼位置部分不工作?
- 4. 爲什麼不dajax分配工作?
- 5. 爲什麼我的分段不工作
- 6. 爲什麼不CGPathIsRect工作?爲什麼CGPathContainsPoint不工作?
- 7. Mercurial推不工作
- 8. 爲什麼不工作
- 9. 爲什麼WAMP不工作?
- 10. 爲什麼history.pushState不工作?
- 11. 爲什麼不addClass工作
- 12. 爲什麼scrollTop不工作?
- 13. 爲什麼:不工作?
- 14. 爲什麼PathFileExists()不工作?
- 15. mozRequestFullScreen();不工作。爲什麼?
- 16. 爲什麼PNP4Nagios不工作
- 17. 爲什麼element.Text =不工作
- 18. textFieldBeginEditing不工作 - 爲什麼?
- 19. 爲什麼socket.sendall()不工作?
- 20. 爲什麼不工作
- 21. 爲什麼不工作
- 22. 爲什麼AlarmMAnager不工作?
- 23. 爲什麼不工作?
- 24. 爲什麼AuthorizationExecuteWithPrivileges不工作
- 25. JQuery不工作,爲什麼?
- 26. 爲什麼不工作
- 27. 爲什麼ToolboxBitmapAttribute不工作?
- 28. countDownTimer不工作,爲什麼?
- 29. 爲什麼不工作
- 30. 爲什麼'源'不工作?
如果您想允許我們提供幫助,您必須提供您使用的命令行和結果。 – Klaim
在做'hg diff'之前你做過'hg commit'嗎?如果是這樣,則不會顯示任何更改。 – nye17