diff --git a/git-primer.tex b/git-primer.tex index e4d7164..872b738 100644 --- a/git-primer.tex +++ b/git-primer.tex @@ -741,6 +741,39 @@ git push --delete \todo[inline]{Add information about directory contents in the different branches} +Note that what you see in your directory (both in a text editor and in your GUI) will depend upon which branch you have checked out. For example, in our branching example, we will first check out the \texttt{main} branch and then do a file listing: + +\input{include/gitcheckoutmain&ls} + +which will then give us this output: + +\begin{Verbatim}[] +doc_a.txt +\end{Verbatim} + +Here's a screen capture of our online version, but if you've cloned this locally and are looking at the \texttt{main} branch, you should see something like this: + +\vspace{0.5\baselineskip} +\frame{\includegraphics[scale=0.75]{gitea-checkout-main}} +\vspace{\baselineskip} + +If we checkout the \texttt{testbranch} branch and then do a file listing: + +\input{include/gitcheckouttestbranch&ls} + +we get this output: + +\begin{Verbatim}[] +doc_a.txt doc_b.txt +\end{Verbatim} + +Again, here's a screen capture of our online version, which should resemble what you see in your GUI if you've cloned this: + +\vspace{0.5\baselineskip} +\frame{\includegraphics[scale=0.75]{gitea-checkout-testbranch}} + + + \section{Uses of Branching} \todo[inline]{Add notes about uses in technical writing, creative writing} diff --git a/images/gitea-checkout-main.png b/images/gitea-checkout-main.png new file mode 100644 index 0000000..2941d48 Binary files /dev/null and b/images/gitea-checkout-main.png differ diff --git a/images/gitea-checkout-testbranch.png b/images/gitea-checkout-testbranch.png new file mode 100644 index 0000000..f3e435f Binary files /dev/null and b/images/gitea-checkout-testbranch.png differ diff --git a/include/gitcheckoutmain&ls.tex b/include/gitcheckoutmain&ls.tex new file mode 100644 index 0000000..e77a364 --- /dev/null +++ b/include/gitcheckoutmain&ls.tex @@ -0,0 +1,4 @@ +\begin{Verbatim}[] +$ git checkout main +$ ls +\end{Verbatim} diff --git a/include/gitcheckouttestbranch&ls.tex b/include/gitcheckouttestbranch&ls.tex new file mode 100644 index 0000000..aef051a --- /dev/null +++ b/include/gitcheckouttestbranch&ls.tex @@ -0,0 +1,4 @@ +\begin{Verbatim}[] +$ git checkout testbranch +$ ls +\end{Verbatim}