{\ttfamily kdb merge \mbox{[}options\mbox{]} ourpath theirpath basepath resultpath}~\newline



\begin{DoxyItemize}
\item ourpath\+: Path to the keyset to serve as {\ttfamily ours}~\newline

\item theirpath\+: path to the keyset to serve as {\ttfamily theirs}~\newline

\item basepath\+: path to the {\ttfamily base} keyset~\newline

\item resultpath\+: path without keys where the merged keyset will be saved~\newline

\end{DoxyItemize}

Does a three-\/way merge between keysets.~\newline
 On success the resulting keyset will be saved to mergepath.~\newline
 On unresolved conflicts nothing will be changed.~\newline


The {\ttfamily kdb merge} command uses a three-\/way merge by default.~\newline
 A three-\/way merge is when three versions of a file (or in this case, Key\+Set) are compared in order to automatically merge the changes made to the Key\+Set over time.~\newline
 These three versions of the Key\+Set are\+:~\newline



\begin{DoxyItemize}
\item {\ttfamily base}\+: The {\ttfamily base} Key\+Set is the original version of the Key\+Set.~\newline

\item {\ttfamily ours}\+: The {\ttfamily ours} Key\+Set represents the user\textquotesingle{}s current version of the Key\+Set.~\newline
 This Key\+Set differs from {\ttfamily base} for every key you changed.~\newline

\item {\ttfamily theirs}\+: The {\ttfamily theirs} Key\+Set usually represents the default version of a Key\+Set (usually the package maintainer\textquotesingle{}s version).~\newline
 This Key\+Set differs from {\ttfamily base} for every key someone has changed.~\newline

\end{DoxyItemize}

The three-\/way merge works by comparing the {\ttfamily ours} Key\+Set and the {\ttfamily theirs} Key\+Set to the {\ttfamily base} Key\+Set. By looking for differences in these Key\+Sets, a new Key\+Set called {\ttfamily result} is created that represents a merge of these Key\+Sets.~\newline


Conflicts occur when a Key has a different value in all three Key\+Sets.~\newline
 Conflicts in a merge can be resolved using a \href{\#STRATEGIES}{\texttt{ strategy}} with the {\ttfamily -\/s} option. To interactively resolve conflicts, use the {\ttfamily -\/i} option.


\begin{DoxyItemize}
\item {\ttfamily -\/H}, {\ttfamily -\/-\/help}\+: Show the man page.
\item {\ttfamily -\/V}, {\ttfamily -\/-\/version}\+: Print version info.
\item {\ttfamily -\/p}, {\ttfamily -\/-\/profile $<$profile$>$}\+: Use a different kdb profile.
\item {\ttfamily -\/C}, {\ttfamily -\/-\/color $<$when$>$}\+: Print never/auto(default)/always colored output.
\item {\ttfamily -\/f}, {\ttfamily -\/-\/force}\+: Will remove existing keys from {\ttfamily resultpath} instead of failing.
\item {\ttfamily -\/s}, {\ttfamily -\/-\/strategy $<$name$>$}\+: Specify which strategy should be used to resolve conflicts.
\item {\ttfamily -\/v}, {\ttfamily -\/-\/verbose}\+: Explain what is happening. Prints additional information in case of errors/warnings.
\item {\ttfamily -\/d}, {\ttfamily -\/-\/debug}\+: Give debug information. Prints additional debug information in case of errors/warnings.
\item {\ttfamily -\/i}, {\ttfamily -\/-\/interactive} Interactively resolve the conflicts.
\end{DoxyItemize}

To complete a simple merge of three Key\+Sets\+:~\newline
 {\ttfamily kdb merge user/ours user/theirs user/base user/result}~\newline


To complete a merge whilst using the {\ttfamily ours} version of the Key\+Set to resolve conflicts\+:~\newline
 {\ttfamily kdb merge -\/s ours user/ours user/theirs user/base user/result}~\newline


To complete a three-\/way merge and overwrite all current keys in the {\ttfamily resultpath}\+:~\newline
 {\ttfamily kdb merge -\/s cut user/ours user/theirs user/base user/result}~\newline



\begin{DoxyItemize}
\item \mbox{\hyperlink{doc_help_elektra-merge-strategy_md}{elektra-\/merge-\/strategy(7)}}
\item \mbox{\hyperlink{doc_help_elektra-key-names_md}{elektra-\/key-\/names(7)}} for an explanation of key names. 
\end{DoxyItemize}