gpt4 book ai didi

linux - 如何在网络上的 2 个文件夹中获取所有文件之间的差异?

转载 作者:IT老高 更新时间:2023-10-28 12:26:13 26 4
gpt4 key购买 nike

所以我想 compare this folder http://cloudobserver.googlecode.com/svn/branches/v0.4/Boost.Extension.Tutorial/libs/boost/extension/this http://svn.boost.org/svn/boost/sandbox/boost/extension/。结果我想得到一个差异文件。这些文件夹受 svn 控制,但我更喜欢 git 样式的差异文件(如 shown here )我试过 git diff 但它似乎不适用于 web 文件夹。那么如何在 Linux 上用一个命令做同样的事情呢?

更新:所以我们有 a great answer .但是它的工作原理很奇怪-在我看来,它表明所有文件(相同的文件)的所有内容都替换为完全相同的内容(虽然我确定只有 3-4 行代码行发生了变化)...

更新 2:为了实现我真正需要的(在 Linux 上只有真正改变的行的 dif 文件,使用 git 样式):

$ svn export http://cloudobserver.googlecode.com/svn/branches/v0.4/Boost.Extension.Tutorial/libs/boost/extension/ repos2 --native-eol CRLF
$ svn export http://svn.boost.org/svn/boost/sandbox/boost/extension/ repos --native-eol CRLF
$ git diff repos repos2 > fileWithReadableDiff.diff

最佳答案

一旦你有了源代码树,例如

diff -ENwbur repos1/ repos2/ 

更好

diff -ENwbur repos1/ repos2/  | kompare -o -

并在一个好的 gui 工具中破解它:)

  • -Ewb 忽略大量空白更改
  • -N 检测新文件
  • -u统一
  • -r 递归

关于linux - 如何在网络上的 2 个文件夹中获取所有文件之间的差异?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5874090/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com