1CATLISM, 123-126

Git 101: the basics1CATLISM, 123-126#

As one of the “most widely adopted distributed open source solution for keeping track of changes to files […] git works by creating an environment that retains details of each change made to the fles being tracked, allowing one or more users to have a complete log of the edits made to the data throughout time by the users acting upon it.”2CATLISM, 123. Installation files and instructions can be found on git official website and official documentation [Chacon and Straub, 2022] respectively.
Figure 4.4 graphically summarises the basic operations, exemplified through the actual commands further below.

Figure 4.4 Graphical rendition of git basic workfow

Figure 4.4 Graphical rendition of git basic workfow#

Initiate git in a local folder#

Command [c4.06]#
git init
[c4.06]

Clone a remote repository#

Command [c4.07]#
git clone https://github.com/catlism/catlism.github.io.git
[c4.07]

Add all changes (even from previously untracked files) to the local git database (i.e. stage the changes)#

Command [c4.08]#
git add -A

Record (commit) all changes, along with a textual description of what has been changed#

Command [c4.09]#
git commit -m "Description of the changes"

Send (push) all changes to the remote repository#

Command [c4.10]#
git push

Obtain (fetch) all changes from the remote repository#

Command [c4.11]#
git fetch

Include/apply (fetch) all changes from the remote repository to the local repository#

Command [c4.12]#
git merge

Obtain and include/apply (pull) all changes from the remote repository to the local repository#

Command [c4.13]#
git pull