简体   繁体   English

使用svn diff命令

[英]Using svn diff command

Since I'm a newbie to SVN, my question is a bit simple but before asking here, I did look at the official tutorial but the explanation in there did not give me any clue. 由于我是SVN的新手,我的问题有点简单,但在问这里之前,我确实看过官方教程,但那里的解释并没有给我任何线索。 So I hope I can find someone to simply them for me. 所以我希望我能找到适合我的人。 Thanks in advance! 提前致谢!

Here is my question: how do I use svn diff to see differences between a file in my repository and the file that I am currently working on? 这是我的问题:如何使用svn diff来查看我的存储库中的文件与我当前正在处理的文件之间的差异? I mean, the file which is changed after the checkout but has not been added and committed yet. 我的意思是,结帐后更改但尚未添加和提交的文件。

I've found the commands: 我找到了命令:

diff [-c M | -r N[:M]] [TARGET[@REV]...]

diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] [PATH...]

diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

but I don't understand what target[@rev], [--new=NEW-TGT[@NEWREV]] [PATH...] etc. means. 但我不明白target[@rev], [--new=NEW-TGT[@NEWREV]] [PATH...]等意味着什么。

Assume I checked out the file to /home/svn/myproject/test.c and made some changes on it .Now I want to check the one which is on repository and this one. 假设我将文件签出到/home/svn/myproject/test.c并对其进行了一些更改。现在我想检查存储库中的那个和这个。 How do I do that? 我怎么做? Thanks in advance! 提前致谢!

After making changes to a checked-out file, you can simply run 更改签出文件后,您只需运行即可

svn diff test.c

The -r and @rev are handy if you want to compare different versions of the file (older revisions). 如果要比较文件的不同版本(旧版本),- -r@rev很方便。 For example, to view the changes made between the two preceding revisions, use 例如,要查看前两个修订版之间所做的更改,请使用

svn diff -r PREV:HEAD test.c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM