\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Shaishav Trivedi} \pdfinfo{ /Title (git-and-github.pdf) /Creator (Cheatography) /Author (Shaishav Trivedi) /Subject (Git \& GitHub Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{6149A3} \definecolor{LightBackground}{HTML}{F5F3F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Git \& GitHub Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Shaishav Trivedi} via \textcolor{DarkBackground}{\uline{cheatography.com/192964/cs/40122/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Shaishav Trivedi \\ \uline{cheatography.com/shaishav-trivedi} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 3rd September, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Create a Repository}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git init {[}project name{]} & The git init command is used to initialize a new Git repository in a directory. When you run this command in a folder, it sets up the necessary Git infrastructure, creating a hidden .git directory where Git stores its configuration files and history. \tn % Row Count 13 (+ 13) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git clone git\_url & Git will create a new directory with the name of the repository by default. \tn % Row Count 17 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\}\$ git clone git\_url my\_directory & The git clone command is used to create a copy of a Git repository from a remote source, such as a URL, into a local directory. \tn % Row Count 24 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Configuration}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git config -{}-global user.name "name" & It is used to configure your Git username globally on your computer. This global configuration sets your Git username for all Git repositories on your system. \tn % Row Count 8 (+ 8) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git config -{}-global user.email "email" & It is used to configure your Git email address globally on your computer. This global configuration sets your Git email address for all Git repositories on your system. \tn % Row Count 17 (+ 9) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git config -{}-global color.ui auto & It is used to enable automatic colorization of Git's output in the terminal or command prompt. It enhances the readability of Git's commands and output by applying color to different elements like branch names, file statuses, and commit information. \tn % Row Count 30 (+ 13) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Configuration (cont)}} \tn % Row 3 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git config -{}-global -{}-edit & It opens the global Git configuration file in your default text editor, allowing you to edit it directly. This configuration file stores various settings that apply to all Git repositories on your system. \tn % Row Count 11 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Working with Branches}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git branch & It is used to list all the branches in your Git repository and show which branch you are currently on. \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git branch -av & It is used to display a more detailed list of branches in your Git repository, including both local and remote branches. It provides information about the branches' names, commit SHAs, and the branches' relationship to remote repositories (if any). \tn % Row Count 19 (+ 13) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git checkout my\_branch & It is used to switch to a different branch in your Git repository. \tn % Row Count 23 (+ 4) % Row 3 \SetRowColor{white} \{\{nobreak\}\} \$ git checkout -b new\_branch & It is a convenient way to create and switch to a new branch in Git in a single step. \tn % Row Count 28 (+ 5) % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git branch -d my\_branch & It is used to delete a local Git branch. However, it will only delete the branch if the changes on that branch have already been merged into the branch you are currently on. This is a safe way to clean up branches that are no longer needed. \tn % Row Count 40 (+ 12) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Working with Branches (cont)}} \tn % Row 5 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git checkout branchB \$ git merge branchA & They are used to switch to "branchB" and then merge changes from "branchA" into "branchB". \tn % Row Count 5 (+ 5) % Row 6 \SetRowColor{white} \{\{nobreak\}\} \$ git tag my\_tag & It is used to create a lightweight or annotated tag in Git, which allows you to mark a specific commit with a label, making it easier to reference or identify later. \tn % Row Count 14 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Synchronize}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git fetch {[}alias{]} & It is used to fetch changes from a remote repository using a specific remote alias. In Git, a remote alias typically represents a remote repository, such as a repository on GitHub or another server. \tn % Row Count 10 (+ 10) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git merge {[}alias{]}/{[}branch{]} & It merges the specified remote branch into your current branch. It performs a regular merge, which may create a new merge commit if there have been changes in both branches. This is the standard way to merge changes from a remote branch into your current branch. \tn % Row Count 24 (+ 14) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git merge -{}-no-ff {[}alias{]}/{[}branch{]} & Adding the -{}-no-ff (no fast-forward) flag to the merge command ensures that a merge commit is always created, even if it could be fast-forwarded. This can be useful to preserve a clear history of feature branches and indicate when a branch was merged. \tn % Row Count 37 (+ 13) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Synchronize (cont)}} \tn % Row 3 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git merge -{}-ff-only {[}alias{]}/{[}branch{]} & Using the -{}-ff-only (only fast-forward) flag instructs Git to perform a fast-forward merge if possible. A fast-forward merge occurs when the branch you're merging into has no new commits since the branch you're merging from. If a fast-forward merge isn't possible (i.e., there are new commits in the current branch), Git will not perform the merge. \tn % Row Count 18 (+ 18) % Row 4 \SetRowColor{white} \{\{nobreak\}\} \$ git push {[}alias{]} {[}branch{]} & It is used to push your local branch to a remote repository represented by the specified remote alias. This command is commonly used to share your local changes with others or to update the remote branch with your local commits. \tn % Row Count 30 (+ 12) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Synchronize (cont)}} \tn % Row 5 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git pull & It is used to fetch changes from a remote repository (commonly referred to as "fetching") and then automatically merge those changes into your current branch. \tn % Row Count 8 (+ 8) % Row 6 \SetRowColor{white} \{\{nobreak\}\} \$ git cherry-pick {[}commit\_id{]} & It is used to apply a specific commit's changes to your current branch. It allows you to select and pick individual commits from one branch and apply them to another branch. This can be useful for incorporating specific changes or fixes from one branch into another. \tn % Row Count 22 (+ 14) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Rename branch}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git branch -m \textless{}new\_name\textgreater{} & It is used to rename the current branch in a Git repository to a new name. \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git push origin -u \textless{}new\_name\textgreater{} & It is used to rename a branch and push it to the remote repository with a new name. \tn % Row Count 9 (+ 5) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git push origin -{}-delete \textless{}old\textgreater{} & It is used to delete a branch from a remote Git repository. \tn % Row Count 12 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Rewriting history}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git commit -{}-amend -m "new message" & It is used to amend (modify) the most recent Git commit with a new commit message. This is useful when you want to change the commit message of the last commit you made. \tn % Row Count 9 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Make a change}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git status & It is used to show the current status of your Git working directory. \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git add {[}file{]} & It is used to stage changes in a file or files for the next commit. It tells Git to include the specified file(s) in the commit. \tn % Row Count 11 (+ 7) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git add . & It stages all changes in the current directory and its subdirectories for the next commit. This means it includes any modifications, additions, or deletions of files in the working directory in the staging area. \tn % Row Count 22 (+ 11) % Row 3 \SetRowColor{white} \{\{nobreak\}\} \$ git commit -m "commit message" & It is used to save the staged changes in your Git repository with a descriptive commit message. This message helps explain the purpose of the commit. \tn % Row Count 30 (+ 8) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Make a change (cont)}} \tn % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git commit -am "commit message" & It is a convenient way to commit changes in Git. It combines two steps: staging changes (git add .) and committing them with a message (git commit -m "commit message"). \tn % Row Count 9 (+ 9) % Row 5 \SetRowColor{white} \{\{nobreak\}\} \$ git restore {[}file{]} & It is used to undo changes in your working directory or unstage changes from the staging area in Git. \tn % Row Count 15 (+ 6) % Row 6 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git restore -{}-staged {[}file{]} & It is used to unstage specific file from the staging area. \tn % Row Count 18 (+ 3) % Row 7 \SetRowColor{white} \{\{nobreak\}\} \$ git reset {[}file{]} & It is used to unstage changes for a specific file in the Git staging area, effectively removing it from the staging area \tn % Row Count 24 (+ 6) % Row 8 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git diff & It is used to view the differences (changes) between the current state of your working directory and the last committed version in your Git repository. It provides a line-by-line comparison of changes in your files. \tn % Row Count 35 (+ 11) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Make a change (cont)}} \tn % Row 9 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git diff -{}-staged & It is used to view the differences (changes) between the last commit and the files currently staged in the Git staging area. This command shows you what changes you are about to commit. \tn % Row Count 10 (+ 10) % Row 10 \SetRowColor{white} \{\{nobreak\}\} \$ git rebase {[}branch{]} & It is used to reapply the commits from your current branch on top of another branch. It effectively moves your branch's starting point to the tip of the specified branch, incorporating all the changes from the target branch. \tn % Row Count 22 (+ 12) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Observe your Repository}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git log & It is used to display a log of the commit history in your Git repository. When you run this command, Git will show a list of commits in reverse chronological order, with the most recent commits appearing first. \tn % Row Count 11 (+ 11) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git log branchB..branchA & It is used to view the commit history that exists in "branchA" but not in "branchB". In other words, it shows the commits that are unique to "branchA" when compared to "branchB". \tn % Row Count 20 (+ 9) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git log -{}-follow {[}file{]} & It is used to view the commit history of a specific file while also following the file's history when it has been renamed or moved. This is particularly useful when you want to see the complete history of a file, even if it has been renamed at some point. \tn % Row Count 33 (+ 13) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Observe your Repository (cont)}} \tn % Row 3 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git diff branchB...branchA & It is used to compare the differences between two branches, "branchB" and "branchA", in Git. It specifically shows the changes that have occurred on each branch compared to their common ancestor. \tn % Row Count 10 (+ 10) % Row 4 \SetRowColor{white} \{\{nobreak\}\} \$ git show {[}SHA{]} & It is used to display detailed information about a specific commit in your Git repository. \tn % Row Count 15 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Remote}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git remote add {[}alias{]} {[}url{]} & It is used in Git to add a new remote repository as an alias with a specified URL. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git remote & It lists the names of all the remote repositories that are associated with your local Git repository. \tn % Row Count 11 (+ 6) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git remote -v & It is used to list the remote repositories associated with your local Git repository along with their corresponding URLs. The '-v' flag stands for "verbose," and it displays both the remote's alias (nickname) and the URL of the remote repository. \tn % Row Count 24 (+ 13) % Row 3 \SetRowColor{white} \{\{nobreak\}\} \$ git remote rm {[}remote repo name{]} & It is used to remove a remote repository from the list of remote repositories associated with your local Git repository. \tn % Row Count 30 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Remote (cont)}} \tn % Row 4 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git remote set-url origin {[}git\_url{]} & It is used to change the URL associated with an existing remote repository. \tn % Row Count 4 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Temporary Commits}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git stash & It is used in Git to temporarily save changes that you've made to your working directory but don't want to commit immediately. \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git stash list & It is used to display a list of stashes that you have saved in your Git repository. \tn % Row Count 10 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git stash pop & It is used to apply the most recent stash from the stash list and remove it from the stash list. \tn % Row Count 15 (+ 5) % Row 3 \SetRowColor{white} \{\{nobreak\}\} \$ git stash drop & It is used to remove a specific stash from the stash list. \tn % Row Count 18 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Tracking path Changes}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git rm {[}file{]} & It is used in Git to remove a file from the current working directory and the staging area (index), effectively deleting it from the Git repository. \tn % Row Count 8 (+ 8) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git mv {[}existing-path{]} {[}new-path{]} & It is used to rename or move a file or directory within a Git repository. \tn % Row Count 12 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git log -{}-stat -M & It is used to display the commit history of a Git repository with some additional statistics about the changes in each commit, including information about moved or renamed files. \tn % Row Count 21 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Log}} \tn % Row 0 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git log -S'\textless{}a term in the source\textgreater{}' & It is used to search the commit history for changes that introduced or removed a specific string (or term) in the source code. This can be useful for tracking when a particular piece of code was added or removed from the codebase. \tn % Row Count 12 (+ 12) % Row 1 \SetRowColor{white} \{\{nobreak\}\} \$ git log -p \textless{}file\_name\textgreater{} & It is used to view the commit history of a specific file and see the changes (diffs) made to that file in each commit. \tn % Row Count 18 (+ 6) % Row 2 \SetRowColor{LightBackground} \{\{nobreak\}\} \$ git log -{}-pretty=oneline -{}-graph -{}-decorate -{}-all & It is used to display a concise and visually informative representation of the commit history in a Git repository. \tn % Row Count 24 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}