Udates to Git primer

This commit is contained in:
Kenneth John Odle 2024-08-04 11:11:35 -04:00
parent 64cb7296a9
commit 2bef8aa55f

View File

@ -187,22 +187,19 @@ If you want to donate financial support for the creation of this zine (and all t
A long time ago my stepdad had created a successful business screen-printing t-shirts. He had been in the music business (there is a long story here, but it doesn't fit in with this zine) and he realized he could make more money if he printed and sold his own band shirts.
At some point, my parents decided to try to replicate this success. As, at the time, the sure key to success was to have a website (thanks Oprah!), I got roped in, because a long time ago in a galaxy far, far away I had uploaded some HTML files to a free web server and told them "look, I made a web page!" They immediately assumed I was an expert and knew everything about putting a business online, and that I could build a web page that would have us making millions of dollars in mere weeks.
At some point, my parents decided to try to replicate this success. As, at the time, the sure key to success was to have a website and I got roped in, because a long time ago in a galaxy far, far away I had uploaded some HTML files to a free web server and told them "look, I made a web page!" They immediately assumed I was an expert and knew everything about putting a business online, and that I could build a web page that would have us making millions of dollars in mere weeks.
This was not the case, of course. What I learned was this:
\begin{itemize}[noitemsep]
\item Dial-up internet sucks.
\item Clarke's Third Law normally applies, but in the case of parents, even doubly so. (Or squared, or even cubed.)
\item Oprah is a great disseminator of false information.
\item Never go into business with your family, especially your parents.
\end{itemize}
The useful things I learned from that experience were how to be really good at HTML (and without CSS, you had to be really good at copy and paste\footnote{i.e., copypasta}(, how an FTP client works (in this case, Transmit\footnote{\kref{https://panic.com/transmit/}{https://panic.com/transmit/}} on a Mac), and that cPanel really sucks. (If your webhost uses cPanel, \textit{you} can do better, and your webhost \textit{should} do better.)
The useful things I learned from that experience were how to be really good at HTML (and without CSS, you had to be really good at copy and paste), how an FTP client works, and that cPanel really sucks. (If your webhost uses cPanel, \textit{you} can do better, and your webhost \textit{should} do better.)
That business died after three or four orders, which was probably a good thing. (Did I mention you should never go into business with your family, especially your parents? If you make that mistake, get out while the getting is good, or at least before irreparable harm is done.)
But it did set me up with some usable skills when I went back to college. I started substitute teaching once I had enough credits to qualify for that, and so decided to create a website as soon as I could as a marketing tool. And thus, \texttt{mrodle.net} was born.
That business died after three or four orders, which was probably a good thing. But it did set me up with some usable skills when I went back to college. I started substitute teaching once I had enough credits to qualify for that, and so decided to create a website as soon as I could as a marketing tool. And thus, \texttt{mrodle.net} was born.
Unfortunately, it did not live long. I had seriously underestimated how much money was required just to exist and when it came to putting gas in the tank \textit{or} paying webhosting fees, it was an easy decision. One of those things was helping me make money and the other was not. Something had to go, and so the website went. (Fortunately, it was so short-lived that \texttt{archive.org} never caught wind of it.)
@ -501,7 +498,7 @@ If you like the changes you have in the branch, you can then \textit{merge} them
I really dislike writing about how to install things, because 1) space in this zine is limited, 2) methods are subject to change over time, and 3) those instructions are usually available at the other end of a web search. But I love Git and want to encourage as many people as might be helped by it to use it, so recommend starting with \kref{https://git-scm.com/book/en/v2/Getting-Started-Installing-Git}{https://git-scm.com/book/en/v\\2/Getting-Started-Installing-Git}.
\subsection{Git Clients}
\section{Git Clients}
Git is a command line based technology. Yes, there are GUIs out there for Git, and if you are on Windows or macOS, you may find them useful. You can see a fairly comprehensive list at \kref{https://git-scm.com/book/en/v2/Getting-Started-Installing-Git}{https://git-scm.com/book/en/v2/G\\etting-Started-Installing-Git}.
@ -627,6 +624,8 @@ If you visit that original repository that I cloned on GitHub, you'll see that i
For what it's worth, you can have multiple remotes. I can create a remote repository on GitHub, clone it to my local machine, then create a remote somewhere else and add that remote to my local repo. To keep both remotes up to date with local changes, you'll need to push twice, once with \texttt{git push remote1 main} and again with \texttt{git push remote2 main}.
There is a lot more to it than this (I haven't even talked about \texttt{git status} yet!), so I guess I will leave that for part 2 of this primer.
\subsection{Collaborating With Yourself}
I mentioned earlier that you could use Git if you're a writer to keep track of changes to projects, provided you were willing to work with text files. My goal here is to provide at least one workflow for doing that. I'm going to assume a few things:
@ -649,9 +648,7 @@ What does \texttt{git pull} do? It's a combination of two Git commands: \texttt{
\section{Extra Files}
\subsection{\texttt{.gitignore}}
\subsection{\texttt{readme.md}}
If you pull or clone a remote repository, you may notice files like \texttt{.gitignore} and \texttt{README.md}. The first tells Git which files to \textit{not} pay any attention to. (And yes, you will want to make use of this at some point.) The second is a text document written in Markdown (hence the \texttt{.md} file extension) which appears on the front page of the online repo.
\section{Forks and Pull Requests}
@ -689,6 +686,7 @@ Command & Purpose {\& Example, if applicable} \\
\texttt{git push} & {Pushes a commit from a local repo to a remote repo \\ \texttt{git push} <name of remote repo> <name of remote branch> } \\
\texttt{git remote} & {Show only the names of remote repos \\ \texttt{git remote} } \\
\texttt{git remote -v} & {Show both the names and URLs of remote repos \\ \texttt{git remote -v} } \\
\texttt{git status} & Show which files have been staged and which files are waiting to be staged \\
\texttt{git branch} & Show all branches (the current branch is labeled with an asterisk) \\
\texttt{git branch -{}-show-current} & Show only the current branch \\
\end{longtblr}