Edits to chapter 1

This commit is contained in:
Kenneth John Odle 2025-01-26 14:13:04 -05:00
parent 6d4ba834c3
commit ae20025538

View File

@ -193,7 +193,7 @@ The \texttt{fancyvrb} package provides the best environment for code samples, in
The \texttt{tabularray} package is, hands-down, the best package for creating tables on \LaTeX{} that is currently available. It provides a large number of easy to understand formatting options.
\vspace{10mm}
\noindent{}The version number of this document corresponde to a semantic versioning system. For more information, visit \kref{https://semver.org/}{https://semver.org/}.
\noindent{}The version number of this document corresponds to a semantic versioning system. For more information, visit \kref{https://semver.org/}{https://semver.org/}.
\tableofcontents
@ -211,19 +211,21 @@ The \texttt{tabularray} package is, hands-down, the best package for creating ta
Git is version control software. That is, it allows you to record and track changes to a set of files over time. You can then compare different revisions or even revert some files or the entire project back to a previous version.
Git also allows you to experiment easily without worrying about messing up your current work by creating a branch and doing your experimental work on the branch. If you like the experimental work, you can merge it into your main branch, or if you decide you don't like it, you can delete it. Git makes experimenting both fun \textit{and} manageable, but most importantly of all, Git gives you \textit{control}.
\section{What Git Can Do For You}
Git is great if you are a software developer, because as you work you make a \textit{lot} of changes to your code. It's also great if you are a writer, because you can experiment as much as you want and not have to worry about losing or overwriting something. You can just revert to an earlier version, or \textit{branch} in order to experiment. But more about that later.
Git is great if you are a software developer, because as you work you make a \textit{lot} of changes to your code. It's also great if you are a writer, because you can experiment as much as you want and not have to worry about losing or overwriting something.
Git also allows you to experiment easily without worrying about losing your current work by creating and doing your experimental work on a \textit{branch}. If you like the experimental work, you can merge it into your main branch, or if you decide you don't like it, you can delete it. But more about that later.
If you are just getting started in your career in programming, Git will have a lot of benefits for you. It can streamline your coding process, help you avoid losing work (and thus hours), make it easier to collaborate with others, and also give you a place to show off your work when you are looking for a job.
If you are a writer rather than a coder, Git still has a lot to offer you as well. Revisions are a stock in trade for writers, as are experiments, and Git makes those things easily managed. Then too, because Git requires you to use text files (more about that later), you can focus on your writing without having to use any sort of ``distraction-free'' word processing program.
Git makes experimenting both fun \textit{and} manageable, but most importantly of all, Git gives you \textit{control} over your work.
\section{Git Concepts}
If this is your first exposure to version control software you'll make faster progress if you understand some of the basic concepts. If you are coming to Git from a different version control software like Subversion or Mercurial, then many of these concepts will be familiar to you, although they will probably have different names and probably different functions. Keep in mind that all of these technologies work differently, so you may have to retrain your brain to follow a different workflow.
If this is your first exposure to version control software you'll make faster progress if you understand some of the basic concepts. If you are coming to Git from a different version control software like Subversion or Mercurial, then many of these concepts will be familiar to you, although they will probably have different names and slightly functions. Keep in mind that all of these technologies work differently, so you may have to retrain your brain to follow a different workflow.
\paragraph{Concept One: Git exists in both time and space.} This is true of just about all version control software, or at least all the different types I am aware of.
@ -233,9 +235,9 @@ If this is your first exposure to version control software you'll make faster pr
You can work with a local repository only, or you can decide to work with one or more remote repositories. The choice is up to you.
\paragraph{Concept Four: Repositories are multi-dimensional.} If you make a series of commits to a repository, it will be linear in nature. This is perfectly ordinary. But you may get to a point where you want to experiment with something and you're not sure whether you'll like the new version or the old version better. Rather than commit that new version, which overrides the original version, you can \textit{branch} and have both versions existing at the same time. A branch is basically a copy of a repository at this point in time (i.e., from the last commit). You can then switch between branches and test things out. You can treat it like a sandbox, essentially.
\paragraph{Concept Four: Repositories are multi-dimensional.} If you make a series of commits to a repository, it will be linear in nature. This is perfectly ordinary. But you may get to a point where you want to experiment with something and you're not sure whether you'll like the new version or the old version better. Rather than commit that new version, which overrides the original version, you can \textit{branch} and have both versions existing at the same time. A branch is basically a copy of a repository at this point in time (i.e., from the last commit). You can then switch between branches and test things out.
\paragraph{Concept Five: Git works best with text-based files\index{files, text-based}} Anything that has a \texttt{.txt}, \texttt{.html}, \texttt{.css}, \texttt{.php}, etc. extension is easy to track through Git. There's no reason that you can't add binaries, such as images, pdfs, Microsoft Word files, or LibreOffice files. (This document does include at least one image file, for example.) The issue is that because they are binaries, Git won't be able to tell you the difference between versions.
\paragraph{Concept Five: Git works best with text-based files\index{files, text-based}} Anything that has a \texttt{.txt}, \texttt{.html}, \texttt{.css}, \texttt{.php}, etc. extension is easy to track through Git. There's no reason that you can't add binaries, such as images, pdfs, Microsoft Word files, or LibreOffice files. (This document does include at least one image file, for example.) Because they are binaries, Git won't be able to tell you the difference between versions.
\section{Git Clients}
@ -301,7 +303,7 @@ Untracked files:
file3.txt
\end{Verbatim}
The first two lines indicate that so far, nobody has made changes to your remote repository if you have one (see the next chapter for more details). This is typical if you are the only person working on this project, but you may see something different if other people have pushed changes to the remote. We'll talk about this later.
The first two lines indicate that so far, nobody has made changes to your remote repository (which in this case is called ``ogit'') if you have one. (See the next chapter for more details about remote repositories.) This is typical if you are the only person working on this project, but you may see something different if other people have pushed changes to the remote. We'll talk about this later.
It then shows files that you have staged under the ``Changes to be comitted:'' list. Notice that if you have committed a file accidentally (which can happen if you are using wildcards), Git is nice and provide the command you need to reverse that change (\texttt{git restore}).