Linux 使用 svn diff 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18232195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:32:28  来源:igfitidea点击:

Using svn diff command

linuxsvndiff

提问by caesar

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. So I hope I can find someone to simply them for me. Thanks in advance!

由于我是 SVN 的新手,我的问题有点简单,但在问这里之前,我确实看过官方教程,但那里的解释没有给我任何线索。所以我希望我能找到一个人来为我简化它们。提前致谢!

Here is my question: how do I use svn diffto see differences between a file in my repository and the file that I am currently working on? I mean, the file which is changed after the checkout but has not been added and committed yet.

这是我的问题:如何svn diff查看存储库中的文件与我当前正在处理的文件之间的差异?我的意思是,在结帐后更改但尚未添加和提交的文件。

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.cand made some changes on it .Now I want to check the one which is on repository and this one. How do I do that? Thanks in advance!

假设我检出文件/home/svn/myproject/test.c并对其进行了一些更改。现在我想检查存储库中的一个和这个。我怎么做?提前致谢!

采纳答案by choroba

After making changes to a checked-out file, you can simply run

对签出的文件进行更改后,您只需运行

svn diff test.c

The -rand @revare handy if you want to compare different versions of the file (older revisions). For example, to view the changes made between the two preceding revisions, use

如果您想比较文件的不同版本(旧版本),-r@rev很方便。例如,要查看前两个修订版之间所做的更改,请使用

svn diff -r PREV:HEAD test.c