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


\begin{DoxyItemize}
\item ourpath\+: Path to the keyset to serve as {\ttfamily ours}
\item theirpath\+: path to the keyset to serve as {\ttfamily theirs}
\item basepath\+: path to the {\ttfamily base} keyset
\item resultpath\+: path without keys where the merged keyset will be saved
\end{DoxyItemize}

\subsection*{D\+E\+S\+C\+R\+I\+P\+T\+I\+O\+N}

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

\subsection*{T\+H\+R\+E\+E-\/\+W\+A\+Y M\+E\+R\+G\+E}

The {\ttfamily kdb merge} command uses a three-\/way merge by default. 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. These three versions of the Key\+Set are\+:


\begin{DoxyItemize}
\item {\ttfamily base}\+: The {\ttfamily base} Key\+Set is the original version of the Key\+Set.
\item {\ttfamily ours}\+: The {\ttfamily ours} Key\+Set represents the user's current version of the Key\+Set. This Key\+Set differs from {\ttfamily base} for every key you changed.
\item {\ttfamily theirs}\+: The {\ttfamily theirs} Key\+Set usually represents the default version of a Key\+Set (usually the package maintainer's version). This Key\+Set differs from {\ttfamily base} for every key someone has changed.
\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.

\subsection*{C\+O\+N\+F\+L\+I\+C\+T\+S}

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

\subsection*{O\+P\+T\+I\+O\+N\+S}


\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 s}, {\ttfamily -\/-\/strategy $<$name$>$}\+: Specify which strategy should be used to resolve conflicts.
\item {\ttfamily -\/v}, {\ttfamily -\/-\/verbose}\+: Explain what is happening.
\item {\ttfamily -\/i}, {\ttfamily -\/-\/interactive} Interactively resolve the conflicts.
\item {\ttfamily -\/\+C}, {\ttfamily -\/-\/color}=\mbox{[}when\mbox{]}\+: Print never/auto(default)/always colored output.
\end{DoxyItemize}

\subsection*{E\+X\+A\+M\+P\+L\+E\+S}

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

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

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

\subsection*{S\+E\+E A\+L\+S\+O}


\begin{DoxyItemize}
\item \hyperlink{md_doc_help_elektra-merge-strategy_doc_help_elektra-merge-strategy_md}{elektra-\/merge-\/strategy(7)} 
\end{DoxyItemize}