\documentclass[10pt]{article}
\usepackage[top=2.75cm, bottom=0cm, left=1.5cm, right=1.5cm]{geometry}

% Discourage hyphenation - doesn't look as good in CVs.
\hyphenpenalty=5000
\tolerance=1000

% Adjust lengths
\setlength{\headheight}{0cm}
\setlength{\headsep}{0cm}
\setlength{\footskip}{0cm}

\setlength{\parindent}{0cm}

% New lengths and commands for my CV
\newcommand{\HR}{\rule{0.5cm}{0.5pt}}
\newlength{\cvsep}
\setlength{\cvsep}{0.3cm}
\newlength{\vcvsep}
\setlength{\vcvsep}{0.2cm}
\newlength{\cvtitles}
\setlength{\cvtitles}{2.9cm}
\newlength{\cvmain}
\setlength{\cvmain}{\textwidth}
\addtolength{\cvmain}{-\cvtitles}
\addtolength{\cvmain}{-\cvsep}

% Category environment
\newenvironment{category}[1]
  {\parbox[t]{\cvtitles}{\large\sc\centering #1}\hspace*{\cvsep}\begin{minipage}[t]{\cvmain}}
  {\end{minipage}\vspace*{0.35cm}}

% 21st century - make some real links in the PDF, but keep the colors reasonable...
\usepackage{url}
\usepackage[colorlinks=true,urlcolor=blue,citecolor=black,linkcolor=black,final=true]{hyperref}

\begin{document}

\pagestyle{empty}

{\centering
  \huge \bf ITK Git Reference
  \vspace*{0.1cm}
  \hrule
}
\vspace*{0.3cm}

\subsection*{One-time Global Setup}
\begin{category}{Setup User Information}
\parbox[t]{0.6\cvmain}{%
\texttt{git config --global user.name "Jane Doe"\\
git config --global user.email "jane@doe.org"\\
git config --global color.ui auto}}
\parbox[t]{0.38\cvmain}{%
Use your full name.\\
\\
Enable color output in Git (optional).
}
\end{category}

\subsection*{Create and Configure Your Repository}
\begin{category}{Clone Repository}
\parbox[t]{0.6\cvmain}{%
  \texttt{git clone https://github.com/InsightSoftwareConsortium/ITK\\ cd ITK}
}
\parbox[t]{0.38\cvmain}{%
}
\end{category}
\begin{category}{Configure}
\parbox[t]{0.6\cvmain}{%
  \texttt{./Utilities/SetupForDevelopment.sh}
}
\parbox[t]{0.38\cvmain}{%
Follow prompts, sets up local hooks, remotes, push URLs etc.
}
\end{category}

\subsection*{Topic Branch Lifecycle}
\begin{category}{Update}
\parbox[t]{0.6\cvmain}{%
  \texttt{git status\\ git checkout main\\ git pull --rebase upstream main}
}
\parbox[t]{0.38\cvmain}{%
Review local modifications, delete, stash or commit them.
}
\end{category}
\begin{category}{New Topic Branch}
\parbox[t]{0.6\cvmain}{%
  \texttt{git checkout -b my-topic upstream/main}
}
\parbox[t]{0.38\cvmain}{%
Create branch off main.
}
\end{category}
\begin{category}{Write Code}
\parbox[t]{0.6\cvmain}{%
  \texttt{vim MyExistingFile.cxx MyNewFile.cxx}
}
\parbox[t]{0.38\cvmain}{%
Use your favorite editor.
}
\end{category}
\begin{category}{New Commit}
\parbox[t]{0.6\cvmain}{%
  \texttt{git add MyExistingFile.cxx MyNewFile.cxx\\
  git commit}
}
\parbox[t]{0.38\cvmain}{%
Stage changes to existing and new files.\\
Commit changes locally.
}
\end{category}
\begin{category}{Amend Commit}
\parbox[t]{0.6\cvmain}{%
  \texttt{vim MyExistingFile.cxx\\
  git add MyExistingFile.cxx\\
  git commit --amend}
}
\parbox[t]{0.38\cvmain}{%
Edit the file.\\
Stage changes.\\
Amend previous commit locally.
}
\end{category}
\begin{category}{Add Testing Data}
\parbox[t]{0.6\cvmain}{%
  \texttt{git data-upload DataFile.png\\
  \# Add DATA\{DataFile.png\} to CMakeLists.txt\\
  git add -- DataFile.png.cid CMakeLists.txt\\
  git commit --amend}
}
\parbox[t]{0.38\cvmain}{%
Upload a testing data input or baseline image to
  \href{https://content-link-upload.itk.org}{content-link-upload.itk.org}.\\
  Reference the content link in the CMake configuration.\\
  Add the content link and updated CMake configuration.
}
\end{category}
\begin{category}{Submit for Review}
\parbox[t]{0.6\cvmain}{%
  \texttt{git prepush\\ git review-push}
}
\parbox[t]{0.38\cvmain}{%
Check what will be pushed to GitHub.\\
Push the topic to GitHub for review.
Enter the URL returned in your browser, and review and open the pull request.
}
\end{category}
\begin{category}{Respond to Review}
\parbox[t]{0.6\cvmain}{%
  % sim -> Improved tilde
  \texttt{git rebase -i HEAD{\raise.17ex\hbox{$\scriptstyle\sim$}}3\\ git prepush\\ git review-push --force}
}
\parbox[t]{0.38\cvmain}{%
Modify local commits (3 back here).\\
Check what will be pushed to Gerrit.\\
Push the updated topic to Gerrit.
}
\end{category}
\begin{category}{Delete Topic}
\parbox[t]{0.6\cvmain}{%
  \texttt{git fetch upstream\\ git branch -d my-topic}
}
\parbox[t]{0.38\cvmain}{%
Fetch the latest changes from origin.\\
Delete topic, fails if not merged.
}
\end{category}

\newpage
\subsection*{Review}
\begin{category}{Push for Review}
\parbox[t]{0.6\cvmain}{%
  \texttt{git review-push}
}
\parbox[t]{0.38\cvmain}{%
Push the current topic branch for review.
}
\end{category}
\begin{category}{Review Pull Requests}
\parbox[t]{0.6\cvmain}{%
  \texttt{git pr $<$pull-request-number$>$}
}
\parbox[t]{0.38\cvmain}{%
Fetch and check out by number a pull request locally for review.
}
\end{category}
\begin{category}{Clean Pull Requests}
\parbox[t]{0.6\cvmain}{%
  \texttt{git pr-clean}
}
\parbox[t]{0.38\cvmain}{%
Clean locally fetched pull requests.
}
\end{category}

\subsection*{General Guidelines}
\begin{category}{Commit Message}
\parbox[t]{0.6\cvmain}{%
  \texttt{<short-description>\\ \\ <long description>\\ Issue \#1234}
}
\parbox[t]{0.38\cvmain}{%
Should be less than 78 characters.\\
Blank line after short description.\\
Could be several paragraphs.\\
GitHub issue number, if applicable.
}
\end{category}
\begin{category}{Topic Naming}
\parbox[t]{0.6\cvmain}{%
  \texttt{summary-of-topic}
}
\parbox[t]{0.38\cvmain}{%
Lower case, separated by dashes.
}
\end{category}


\begin{center}
For more information, see \href{https://git-scm.com/}{git-scm.com}.
\end{center}

\end{document}
