summaryrefslogtreecommitdiffstats
path: root/doc/en/documentation.html
blob: 969cf42b762d4c0a727f77c9193a5c05ad536100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<html><head><title>Chapter 2. File Comparison And Merge</title><link rel="stylesheet" href="help:/common/tde-default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.67.2"><meta name="keywords" content="KDE, kdeextragear, kdiff3, diff, merge, CVS, triplediff, compare, files, directories, version control, three-way-merge, in-line-differences, synchronise, kpart, tdeio, networktransparent, editor, white space, comments"><link rel="start" href="index.html" title="The KDiff3 Handbook"><link rel="up" href="index.html" title="The KDiff3 Handbook"><link rel="prev" href="features.html" title="More Features"><link rel="next" href="opendialog.html" title="Open-Dialog"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="GENERATOR" content="KDE XSL Stylesheet V1.13 using libxslt"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div style="background-image: url(help:/common/top-middle.png); width: 100%; height: 131px;"><div style="position: absolute;                      right: 0px;"><img src="help:/common/top-right-konqueror.png" style="margin: 0px" alt=""></div><div style="position: absolute;                         top: 25px;                          right: 100px;                          text-align: right;                          font-size: xx-large;                          font-weight: bold;                          text-shadow: #fff 0px 0px 5px;                          color: #444">File Comparison And Merge</div></div><div style="margin-top: 20px; background-color: #white;                        color: black;                       margin-left: 20px;                        margin-right: 20px;"><div style="position: absolute;                          left: 20px;"><a accesskey="p" href="features.html">Prev</a></div><div style="position: absolute;                          right: 20px;"><a accesskey="n" href="opendialog.html">Next</a></div><div class="navCenter"> </div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="documentation"></a>Chapter 2. File Comparison And Merge</h2></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="commandline"></a>Command-Line Options</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488302"></a>Comparing 2 files: </h3></div></div></div><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2</code></em></span>
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488321"></a>Merging 2 files: </h3></div></div></div><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2</code></em></span> -m
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2</code></em></span> -o <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>outputfile</code></em></span>
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488352"></a>Comparing 3 files: </h3></div></div></div><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2 file3</code></em></span>
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488370"></a>Merging 3 files: </h3></div></div></div><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2 file3</code></em></span> -m
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1 file2 file3</code></em></span> -o <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>outputfile</code></em></span>
</pre><p>
   Note that <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file1</code></em></span> will be treated as
   base of <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file2</code></em></span> and
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>file3</code></em></span>.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488418"></a>Special case: Files with the same name </h3></div></div></div><p>
If all files have the same name but are in different directories, you can
reduce typework by specifying the filename only for the first file. E.g.:
</p><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>dir1/filename dir2 dir3</code></em></span>
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488444"></a>Commandline for starting a directory comparison or merge: </h3></div></div></div><p>This is very similar, but now it's about directories.</p><pre class="screen">
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>dir1 dir2</code></em></span>
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>dir1 dir2</code></em></span> -o <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>destdir</code></em></span>
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>dir1 dir2 dir3</code></em></span>
   <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>dir1 dir2 dir3</code></em></span> -o <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>destdir</code></em></span>
</pre><p>For directory comparison and merge you can continue to read <a href="dirmerge.html" title="Chapter 3. Directory Comparison and Merge with KDiff3">here</a>.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488514"></a>Other command line options</h3></div></div></div><p>To see all available command line options type</p><pre class="screen">
<span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="command"><span><strong class="command">kdiff3</strong></span></span> --help
</pre><p>Example output:</p><pre class="screen">
Options:
  -m, --merge               Merge the input.
  -b, --base file           Explicit base file. For compatibility with certain tools.
  -o, --output file         Output file. Implies -m. E.g.: -o newfile.txt
  --out file                Output file, again. (For compatibility with certain tools.)
  --auto                    No GUI if all conflicts are auto-solvable. (Needs -o file)
  --qall                    Don't solve conflicts automatically. (For compatibility...)
  --L1 alias1               Visible name replacement for input file 1 (base).
  --L2 alias2               Visible name replacement for input file 2.
  --L3 alias3               Visible name replacement for input file 3.
  -L, --fname alias         Alternative visible name replacement. Supply this once for every input.
  --cs string               Override a config setting. Use once for every setting. E.g.: --cs "AutoAdvance=1"
  --confighelp              Show list of config settings and current values.
  --config file             Use a different config file.
</pre><p>The option <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="option"><code class="option">--cs</code></span> allows you to adjust a configuration value that is otherwise only adjustable via the configure dialogs. 
But be aware that when <span class="application">KDiff3</span> then terminates the changed value will be stored along with the other settings. 
With <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="option"><code class="option">--confighelp</code></span> you can find out the names of the available items and current values.</p><p>Via <span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="option"><code class="option">--config</code></span> you can specify a different config file. When you often use <span class="application">KDiff3</span> 
with completely different setups this allows you to easily switch between them.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2488593"></a>Ignorable command line options</h3></div></div></div><p>Many people want to use <span class="application">KDiff3</span> with some version control system. 
But when that version control system calls <span class="application">KDiff3</span> using command line parameters that <span class="application">KDiff3</span> doesn't recognise, then <span class="application">KDiff3</span> terminates with an error.
The integration settings allow to specify command line parameters that should be ignored by <span class="application">KDiff3</span>. 
They will appear in the usage help like in this example:</p><pre class="screen">
  --<span xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" class="replaceable"><em class="replaceable"><code>foo</code></em></span>                     Ignored. (User defined.)
</pre><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>Command line options to ignore:</em></span></span></dt><dd><p>
     A list of options, separated via semicolon ';'. When one of these options appears on the commandline, 
     then <span class="application">KDiff3</span> will ignore it and run without reporting an error. 
     (Default is "u;query;html;abort").</p></dd></dl></div><p>When this isn't enough, then it is recommended to write a shell script that does the option translation.</p></div></div></div><div style="background-color: #white; color: black;                  margin-top: 20px; margin-left: 20px;                  margin-right: 20px;"><div style="position: absolute; left: 20px;"><a accesskey="p" href="features.html">Prev</a></div><div style="position: absolute; right: 20px;"><a accesskey="n" href="opendialog.html">Next</a></div><div align="center"><a accesskey="h" href="index.html">Home</a></div></div><div style="background-color: #white;   color: black;         margin-left: 20px;   margin-right: 20px;"><div class="navLeft">More Features </div><div class="navRight"> Open-Dialog</div><div class="navCenter"><a accesskey="u" href="index.html">Up</a></div></div><br><br><div class="bannerBottom" style="background-image: url(help:/common/bottom-middle.png);                                        background-repeat: x-repeat;                                         width: 100%;                                         height: 100px;                                         bottom:0px;"><div class="BannerBottomRight"><img src="help:/common/bottom-right.png" style="margin: 0px" alt=""></div><div class="bannerBottomLeft"><img src="help:/common/bottom-left.png" style="margin: 0px;" alt=""></div><div id="comments" style="position:relative; top: 5px; left: 1em; height:85px; width: 50%; color: #cfe1f6"><p>Would you like to make a comment or contribute an update to this page?<br>
        Send feedback to the <a href="mailto:kde-docs@kdemail.net" style="background:transparent; color:#cfe1f6; text-decoration: underline;">KDE Docs Team</a></p></div></div></body></html>