100% found this document useful (1 vote)
352 views

GitHub and Git: A Guide

This document provides an introduction and overview of the Learn and Apply education platform and its GitHub and Git: A Guide course. It discusses installing Git Bash and configuring global Git settings. The Learn and Apply platform offers free, multilingual, video-based courses on various topics through books, videos, and audiobooks produced using artificial intelligence tools. The Dridi Foundation created Learn and Apply as an accessible education resource.

Uploaded by

Learn and Apply
Copyright
© Public Domain
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
352 views

GitHub and Git: A Guide

This document provides an introduction and overview of the Learn and Apply education platform and its GitHub and Git: A Guide course. It discusses installing Git Bash and configuring global Git settings. The Learn and Apply platform offers free, multilingual, video-based courses on various topics through books, videos, and audiobooks produced using artificial intelligence tools. The Dridi Foundation created Learn and Apply as an accessible education resource.

Uploaded by

Learn and Apply
Copyright
© Public Domain
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

*LW+XE

{ }
DQG
*LW
$*8,'(>
Part of
Learn and Apply
A quality, accessible, and free education facilitates economic
mobility and positive change to our world

It provides opportunities and transforms lives for the better

1
Identifiers
Authors and course developers:
Eng. Ridha Dridi
Mrs. Fathia Jelassi Ep Dridi
Aziz Dridi
Salim Dridi

Title:
GitHub and Git: A Guide / The Dridi Foundation

Series:
Learn and Apply series
Includes references

March 2024: First Edition

2
About Learn and Apply, an
Education Project by The
Dridi Foundation
Learn and Apply is a concise, accessible, and free multilingual
education platform providing video courses, books, and audiobooks on
different topics. It's the first education platform to use Artificial
Intelligence to translate books and produce audio for the courses. The
courses demonstrate the books.

Different series on Programming, Finance and Accounting, Mathematics


and Statistics, Sciences, Humanities, and Languages are offered.

For the first editions, the content is available in 11 languages; the


courses, books, and audiobooks with the symbol ȕ, were translated and
had their audio generated using Artificial Intelligence-based tools.

The French and Arabic versions were produced by Eng. Ridha Dridi,
Aziz Dridi, and Salim Dridi.

Learn and Apply is also available as an app on Android and iPhone.


Search for Learn and Apply on the different App Stores.
LearnApply.org

About The Dridi Foundation


The foundation's impact and productions are a collective effort by the
members of Mr. Ridha Dridi's family. Mrs. Fathia Jelassi Ep Dridi is his
wife and Aziz Dridi and Salim Dridi are his sons.

The foundation's projects are dedicated to the greater economic and


social good of humanity.
Dridi.org

The Foundation’s Other Projects in 2024

Third Pillar is a web and mobile app for Muslims to help them calculate
and pay their obligatory alms, Zakat. Zakat is the third of the five pillars
of Islam.

3
ThirdPillar.net

The Dridi and Jelassi families are from Tunisia. To help improve the
economic conditions of Tunisia and provide opportunities, The
foundation submitted funding applications to USAID, USADF, and other
public and private organizations to finance the production of renewable
energy. Increasing Tunisia's generation of solar power was suggested.

To view the status of this proposal Dridi.org/solar

4
The Foundation’s
Commitment to Equality,
Diversity, and Inclusion
The Dridi Foundation acknowledges the diversity of the readers in their
different identities, backgrounds, and views, and the content is created
free from bias toward these aspects.
The Foundation is dedicated to creating educational content in different
languages.
Visual learning differences were considered when creating the material,
and accessible versions of the books are available.

For concerns about bias or to suggest improvements to accessibility


aspects, e-mail
contact@learnapply.org

5
Legal Information
Learn and Apply is an education project produced by The Dridi
Foundation.

The Dridi Foundation


510 Clinton Square
Rochester, NY 14604
United States

Directors and owners:


Ridha Dridi, Fathia Jelassi Ep Dridi, Aziz Dridi, Salim Dridi

E-Mail: contact@dridi.org
Phone: +1 607-216-7767
Fax: +1 607-360-6587

GitHub and Git: A Guide is published in compliance with the laws of the
United States of America and placed in the public domain in its entirety
under the terms of the Creative Commons Zero (CC0) license. The
materials presented are freely available for any use without attribution
or restriction.

In addition to the logos of GitHub and Git, this book may contain other
images, logos, and names that are trademarked.

Instead of using a trademark symbol whenever a registered name, logo,


or image appears, the authors only use them editorially for the benefit
of the readers and without the intention of violating proprietary rights.

The use of trade names, trademarks, service marks, and similar terms
in this publication is not to be taken as an expression of opinion as to
whether they are subject to proprietary rights.

The guidance and data presented in this book are deemed reliable and
correct. Despite this, The Dridi Foundation and the authors are not liable
for errors or omissions and make no warranty express or implied,
concerning the material contained.

The online Cambridge and Collins dictionaries and the artificial


intelligence-based tools Google Gemini, Microsoft Copilot, GPT, DeepL,
Google Translate, and Microsoft Azure Speech Studio assisted with
ideas, writing, translation, and audio generation.

6The Dridi Foundation


Table of Content

7
Chapter 1
Fundamentals
Outline
After a short introduction to the book and its video course, the
fundamentals chapter begins with installing and setting up the
necessary programs and accounts, then discusses the basics of Git,
including its three stages: the working directory, staging area, and
repository and its components: branches, commits, tags, trees, blobs,
and references. It also provides an overview of common git commands
and concludes with a couple of advanced techniques: combining
commits using squashing and saving changes temporarily using
stashing and worktrees.

8
Chapter 1: Fundamentals

Unit 1.1
Introduction
learnapply.org/course/intro

1.1.1 Introduction to the book


GitHub and Git: A Guide is an intermediate level book that covers the
content from an applied point of view. An audiobook version of this book
has been produced.
This book follows Learn and Apply’s video course that demonstrates the
content. The course is available on different platforms, including Learn
and Apply's website and YouTube.
Learn and Apply is also available as an app on Android and iOS.

If you’re familiar with GitHub and Git, we recommend you watch the
project example:
learnapply.org/git/demo
The code files are available on GitHub:
github.com/learnapply/git

Below each unit is a link to the corresponding Learn and Apply web
page, which includes the video demonstration.
The Programming series uses Windows as the operating system, but
everything can be replicated on MacOS or Linux.
This book explains most topics related to GitHub and the Git version
control system. It describes many Git commands and details common
use cases and options.
Previous experience isn’t required.
It explains the benefits of using Git to manage code files, such as
branching and history management.
The book covers GitHub starting chapter 3. It enables remote
repositories and provides collaboration features and additional services
such as Actions and Pages.

80 ȱ 9
Chapter 1: Fundamentals

In projects, Git and GitHub aren't used in a straightforward way, and


most aspects of programming commands and techniques are combined
and adapted.
Practice makes perfect. Apply the content of this book to a personal
project and try to use GitHub and Git in all future software development,
regardless of programming language.

1.1.2 Introduction to GitHub and Git


Git, short for Global Information Tracker, is the most popular version
control system and has the largest online support community for
developers. This is useful for fixing bugs and implementing new ideas.
By using Git for a project, a programmer or team of programmers can
track, compare, and revert changes made to files.
Git includes features that make it easy to integrate changes made by
different developers into the main code base of a project.
It also helps with auditing and compliance through its history
management features. It keeps track of who made changes, when they
were made, and the reasons given by the programmers in the form of
commit messages. Commit messages are similar to code comments
used in programming languages.
Git can be used on personal computers with only local repositories.
However, most programmers and teams prefer to use it with a cloud
solution like GitHub.
GitHub offers free servers and adds remote repository capabilities. It
also enables features on top of Git, such as pull requests, not to be
confused with the git pull command, and other collaboration and
sharing features when working with a team.
Git is the most popular version control system, and GitHub is the most
popular cloud solution for Git-based projects.

10 ȱ 80
Chapter 1: Fundamentals

Unit 1.2
Installation and setup
learnapply.org/git/1.2

1.2.1 Git Bash


The program Git Bash bundles all the tools required to operate Git and
GitHub from the command line.
Windows gitforwindows.org
macOS, Linux git-scm.com
Once installed, Git commands can run either inside the Git Bash
command line user interface or the command line of the Windows,
macOS, or Linux operating systems.
Alternatively, for Mac, Homebrew, a package manager for managing
software, can be used to install Git.
macOS brew.sh
Once Homebrew is installed, type brew install git in the command
line to install Git.

1.2.2 Global configurations


git config allows for the configuration of certain settings when using
Git. Include --global as an option to set them globally. Global
configurations are placed in the .gitconfig file.

Code 1 Common global configurations

Example Description
Sets Visual Studio Code as
git config --global
the default program for
core.editor "code --
manipulating files with Git
wait"
commands
git config --global Configures the Git
user.name "username" username
git config --global
Configures the Git email
user.email "email"
80 ȱ 11
Chapter 1: Fundamentals

git config --global Creates a remote branch


--add –bool when pushing changes if
push.autoSetupRemote the named remote branch
true doesn't exist
git config --global Autocorrects Git command
help.autocorrect 20 mistakes after two seconds
git config --global
Enables rerere
rerere.enabled true
Checks everything has
git config --list
been setup correctly

Reuse Recorded Resolution (rerere) asks Git to remember how it


resolved a hunk conflict so that the next time it sees the same problem,
Git can automatically resolve it.
A hunk conflict is a situation where two different versions of a file are
created, programmers modify them differently, and Git cannot
automatically determine how to merge the changes.

1.2.3 GitHub
To use GitHub, the programmer will need to create an account on
github.com
Once an account has been created, developers need to create a
Personal Access Token (PAT) from their GitHub account's settings.
GitHub discontinued the use of account passwords as an authentication
method inside the command line in 2021. PATs are now used instead.

1.2.4 Code editor and extensions


Visual Studio Code, commonly called VS Code, is the most popular
code editing program. It supports most programming languages and
offers integration with other widely used programmer tools.
Windows, macOS, Linux code.visualstudio.com

12 ȱ 80
Chapter 1: Fundamentals

Additional functionality can be added to VS Code using extensions. In


VS Code, they're installed from the extensions tab in the left vertical bar.
They can also be installed from the marketplace.
marketplace.visualstudio.com
The following are the VS Code extensions used in Learn and Apply's
GitHub and Git video course.
ƒ Prettier: Formats the code syntax of different programming
languages and makes them easier to read
ƒ GitHub Repositories: Helps manage (browse, search, edit,
and commit) remote repositories hosted on GitHub
ƒ GitHub Pull Requests and Issues: Enables management and
review of GitHub's Pull Requests
ƒ GitHub Actions: Helps manage workflows of GitHub Actions

Other popular add-ons include GitDoc and Live Share. GitDoc


automatically commits, pushes, and pulls changes when files are saved.
Live Share allows for real-time collaboration when working with a team.

Unit 1.3
The 3 stages of Git
learnapply.org/git/1.3

Figure 1 Overview of the 3 stages files go through in Git projects

1.3.1 Working Directory


The working directory is where all files are stored and where changes
are made first.
These files and folders can be in 1 of 3 states:
ƒ Tracked: They were previously committed to a repository
ƒ Untracked: They weren't previously committed to a repository
80 ȱ 13
Chapter 1: Fundamentals

ƒ Ignored: The programmer turned off Git's tracking for them.


Unit 4.4 explains how to do this.

1.3.2 Staging Area


The staging area, sometimes called index, is an intermediate area
between the working directory and the repository. Changes must first be
added to the staging area using git add before they are committed to
the repository.
The staging area allows programmers to group many changes into a
focused commit.

1.3.3 Repository
A repository, often referred to as 'repo', is a data structure maintained by
Git. It's the folder containing the project's files and subfolders.
Repositories can be either local or remote if the programmer is using
GitHub.
To save the changes they made, the programmer must commit those
changes using git commit. The repository is where changes are saved
after they have been cohmmitted from the staging area.
The repository tracks changes and contains all objects of the commits
and their references. It also stores the metadata of files and folders of
the Git project.

Unit 1.4
The components of Git
learnapply.org/git/1.4

1.4.1 Branches
Creating branches is the equivalent of creating versions of a codebase.
By using branches, programmers can implement new features and fix
risky bugs in isolation from the production branch.
14 ȱ 80
Chapter 1: Fundamentals

To integrate code changes made in other branches with the main


branch, the commands git merge, git rebase, or git cherry-pick
are used.
To reference a branch in different Git commands, use its name or the
first characters of the commit hash made to that branch. The hash is
found using the command
git log
In addition to the hash, git log displays other information, including
the name of the branch currently being worked on and the date and time
the programmer made the commit.
An alternative to git log is git reflog, discussed in Unit 2.3.

In addition to git branch, other commands exist for different branch


management functions.

Code 2 Common use cases of branch management

Example Description
git branch
Creates a new branch
branch_name
git branch –-
Lists branches containing a
contains
certain commit
commit_hash
git branch -vv Views a branch in more detail
git branch Lists local branches
git branch -d
Deletes the branch
branch_name
Lists both local and remote
git branch –all
branches
git branch - Displays a list of all local
sort=committerdat branches and sort them based
e on the date of their last commit
git branch Shows all the differences
first_branch_name made on the second branch
..second_branch_n since it diverged from the first
ame branch
git checkout
Switches to the named branch
branch_name

80 ȱ 15
Chapter 1: Fundamentals

Discards all untracked


git clean -fd
changes of the current branch
git rev-parse – Prints the name of the current
abbrev-ref HEAD branch
git difftool -t Shows changes done in the
meld –-dir-diff working directory
git difftool -t
meld –-dir-diff
Shows the differences
first_commit_hash
between two commits
second_commit_has
h
git branch –a – Displays a list of all local
merged branches

A best practice is to set different branches for different tasks and not
have too many branches. This helps teams work on a feature in different
ways if they choose to do so.

1.4.2 Commits
Git has 4 types of objects: commits, tags, trees, and blobs.
To save the changes the made, the programmer must save those
changes by committing them using the command
git commit -m "commit_message"

Before committing, adding files to the staging area using


git add

Once committed, they are tracked by Git's system.


In addition to the commit message, each commit contains:
ƒ hashes of tree and parent commit
ƒ name and email of the programmer

The hashes of the tree and parent commit are metadata and pointers to
other Git objects that contain the actual contents of the commit.

16 ȱ 80
Chapter 1: Fundamentals

Similar to branches, commits are referenced in other git commands


using the first characters of the commit hash. The hash is found using
either of these commands
git log
git reflog

Although any number of characters can be used, it's best to use 7 or


more to avoid Git confusing different commits in large projects.

Code 3 Common use cases of git commit and commits

Example Description
git cat-file -p View the contents of a
commit_hash commit
git commit -m
Creates a new commit
commit_message
git commit rev-list -- Lists commits in
online branch1 branch2 branch1 and branch2
^branch3 but not in branch3
It shows the previous
git show
commit
Shows the nth commit
git show @~n from the last commit
made
1. git checkout main
2. git add .
3. git commit -m An example of moving
"commit_message" commits from the main
4. git branch branch to a new branch.
branch_name This doesn't affect
5. git reset HEAD~n –- changes already pushed
hard to a GitHub repository.
6. git checkout
branch_name

To improve productivity, commits should be of the smallest possible size


and each commit can be summarized in a simple sentence.

80 ȱ 17
Chapter 1: Fundamentals

1.4.3 Commit messages


The commit message is a comment left by a programmer as an
explanation of the changes made for future reference by themselves or
by other programmers in the team. They are similar to code comments
in programming languages.
To write good commit messages, follow these rules
1. Use the present tense and the imperative mood
2. Be consistent, clear, and descriptive
3. Message should be a -line summary
4. Provide context for the changes made over the lifespan of the
project
5. Follow correct grammar and punctuation

Examples of the imperative mood include:


ƒ "Fix bugs" instead of "Fixed bugs"
ƒ "Update Doc" instead of "Updated Doc"

Examples of following these rules:


ƒ Make x do z
ƒ Merge Pull Request #123 in a from b
ƒ If I apply this commit, it will do z
ƒ Add feature b

To avoid retyping the same information, programmers can configure a


default template, in the form of a text file, for all future commit messages
using the command
git config commit.template file_name

1.4.4 Tags
Tags are references that point to previous points in the history of a Git
project. They resemble version numbers in programs.

Code 4 Common use cases of working with tags


18 ȱ 80
Chapter 1: Fundamentals

Example Description
git tag Creates a tag of the current
tag_name branch
git tag
tag_name Creates a new commit
commit_hash
git tag Lists all created tags
Finds the most recent tag of a
git describe
commit

1.4.5 Trees
Trees represent a folder's structure and its contents.
Although, they're an essential building block in how Git stores and
manages code versions, no common use cases can be accomplished
with them.

1.4.6 Blobs
Blobs hold the raw data of each file in the repository. There are no
common use cases involving them.

1.4.7 The .git folder


This is a hidden folder in the main directory of every Git project. It's
created immediately after initialization. Initialization is done using git
init

A repository's information is stored inside 3 subfolders in the .git folder:


ƒ Objects
ƒ References
ƒ Heads
This folder contains all the information and metadata needed to manage
a project's version history. It includes the following essential metadata
components for the version control operations of a project.

Configurations The HEAD reference Hooks


pointer
Logs Blobs Tags
Branches Commits Trees

80 ȱ 19
Chapter 1: Fundamentals

To view the contents of the .git folder, use either


ls -a .git

or ls -la .git to view more details

In these commands, the -a option enables viewing hidden files and


folders in the command line.
To see this folder in the file explorer program of your operating system,
enable the ability to view hidden files and folders.

1.4.8 The HEAD pointer


References are the method by which Git points to a branch. The HEAD
reference points to the current branch being worked on.
To view the contents of the HEAD file, use the command
cat .git/HEAD

Sometimes, rather than a single line containing the current branch, the
output of this command will be random text and numbers; in that case,
the HEAD pointer is detached.
This is a situation where the reference is not pointing to any branch and
usually occurs when a programmer creates a new commit without
creating a new branch.
To fix this, either the git checkout or git switch commands are used.

Unit 1.5
Common Git commands and their
options
learnapply.org/git/1.5

To view more detail and information about these commands, follow them

20 ȱ 80
Chapter 1: Fundamentals

with -h or use the command git help. As an example, for more


information on git rm, use the commands

git rm -h
git help rm
Always consult the official Git documentation for a full list of command
options, detailed explanations, and the latest changes.
git-scm.com/docs

1.5.1 git init


git init is the first command typed to start a Git Project in the
command line's current folder. Optionally, it can take a folder's name as
an argument.

1.5.2 git status


git status shows the current state of the working directory and the
staging area. Optionally, add -sb as an argument to view the short form
of the same output.

1.5.3 git add


git add adds changes done in the working directory to the staging
area.
Code 5 Common use cases of git add

Example Description
git add . Adds all files to the Staging Area
Adds modifications of files already in
git add -u the Staging Area without the newly
created files in the Working Directory
git add Adds the selected files to the Staging
file1 Area
file3
An interactive view is displayed on the
git add -i command prompt and the programmer
can select which files are added

80 ȱ 21
Chapter 1: Fundamentals

The last use case is the interactive version of adding. It should be used
when dealing with entangled changes in the working directory that a
programmer would like to split into different commits.
It should also be used if the programmer is in the middle of an interactive
rebase and would like to split a too-large commit.

1.5.4 git commit


git commit saves changes made to the local repository. The changes
made in the working directory must first be added to the staging area
before being committed to the repository. The programmer must specify
a commit message.
git commit -m "commit_message"

1.5.5 git branch


git branch creates branches. Creating branches is the equivalent of
creating versions of a codebase. By using branches, programmers can
implement new features and fix risky bugs in isolation from the
production branch.
Code 6 Common use cases of git branch

Example Description
git branch
Creates a new branch
branch_name
git branch –-
Lists branches containing a
contains
certain commit
commit_hash
git branch -vv Views a branch in more detail
git branch Lists local branches
git branch -d
Deletes the branch
branch_name
Lists both local and remote
git branch –all
branches
git branch - Displays a list of all local
sort=committerdat branches and sort them based
e on the date of their last commit
git branch Shows all the differences
first_branch_name made on the second branch
22 ȱ 80
Chapter 1: Fundamentals

..second_branch_n since it diverged from the first


ame branch

1.5.6 git mv
git mv renames folders, repositories, and local and remote branches.
It can also be used to move files and folders between different locations.
As an example, to change the location of a file to a new location and
add this move to the staging area, use the command
git mv existing_path new_path

1.5.7 git rm
git rm deletes a file from the project and adds its removal to the staging
area for the next commit.
git rm file_name

1.5.8 git log


git log is used to view details of commits. It outputs the commit hash,
the branch currently being worked on, the date and time the commit was
made, and the name and email of the programmer who made the
commit.

Code 7 Common use cases of git log

Example Description
Shows a list of all commits in
git log
chronological order
git log –- Shows all commit logs with an
stat -M indication of any paths that moved
git log -
Lists the version history of a file,
follow
including its renaming history
file_name

1.5.9 git tag and git describe

80 ȱ 23
Chapter 1: Fundamentals

The git tag and git describe commands are used to work with tags.
Tags are references that point to previous points in the history of a Git
project. They resemble version numbers in programs.

Code 8 Common use cases of working with tags

Example Description
git tag Creates a tag of the current
tag_name branch
git tag
tag_name Creates a new commit
commit_hash
git tag Lists all created tags
Finds the most recent tag of a
git describe
commit
1.5.10 git diff
git diff is used to view the differences between files and branches.

Code 9 Common use cases of git diff

Example Description
Shows the differences between the
git diff staged and unstaged versions of
files
Shows differences between files in
git diff -
the staging area and the latest
staged
working directory version
git diff
Shows differences between two
first_branch
branches
second_branch

1.5.11 git blame


git blame is used to annotate every line in a file with the date the line
was created and who made the change
git blame file_name

1.5.12 git show


24 ȱ 80
Chapter 1: Fundamentals

git show is used to view expanded details of Git objects (blobs, trees,
tags, and commits).

Table 1 Output of git show when used with different Git objects

Object Output
Shows the log message and other changes
commit
that occurred in the selected commit
Shows the tag message and other tags
tag
included in the tag
Show the names and contents of objects in
tree
a tree
blob Shows the direct content of the blob

Unit 1.6
Combining commits and saving
changes temporarily
learnapply.org/git/1.6

1.6.1 Squashing
This is a method of combining 2 or more commits into 1. It gives a
cleaner commit history and makes it easier to review changes.
Squashing isn't a dedicated Git operation but is rather used when
merging changes from other branches into the main branch of a project.
It can be used as an option with the git merge and git rebase
commands. It can also be used to squash recent commits.

Code 10 Common use cases of squashing

Example Description
1. git reset
–-soft Squash n recent commits without
HEAD~n rebasing
2. git commit
1. git merge –
Squash during a merge. As an
-squash
alternative to the command line,
branch_name
80 ȱ 25
Chapter 1: Fundamentals

2. git commit GitHub provides a way to squash


during a merge
Squash during an interactive
rebase. The interactive editor will
enable the programmer to choose
which commit to squash and
git rebase -i
prompt them to enter a commit
commit_hash
message. Many programmers opt
to use the commit message to state
which commits were squashed and
where to start a rebase from

1.6.2 Stashing
Stashing is a method of temporarily storing changes made to the
working directory so the programmer can work on something else and
resume work on the changes later.

Code 11 Common use cases of stashing

Example Description
Creates a new stash and saves all
git stash uncommitted changes in the working
directory and staging area
Similar to git stash, but also includes
git stash
untracked files. Untracked files are
push -u
those that were never in a repository
git stash
Creates a new stash and creates a new
branch
branch from it with the specified name
branch_name
git stash
Lists all stashes made
list
git stash Applies changes from the most recent
stash to the working directory but
apply
keeps the stash intact

1.6.3 Worktrees
Worktrees are folders in a Git project where programmers store
changes temporarily. They're an alternative to git stash which
serves the same purpose.

26 ȱ 80
Chapter 1: Fundamentals

Code 12 Common use cases of git worktree

Example Description
1. git
worktree add -
b
emergency_fix
../temp master
2. pushd
../temp Make an emergency fix, remove it
3. git commit when d, and then resume the
-a -m earlier code session
commit_message
4. popd
5. rm -rf
../temp
6. git
worktree prune
git worktree Removes information about a
prune worktree
git worktree
Lists existing worktrees
list

80 ȱ 27
Chapter 6: Advanced and Additional Topics

Chapter 2
History
Management and
Undoing Changes
Outline
This chapter covers various Git features, including undoing, recovering,
modifying, and restoring operations. It also discusses branch
management commands such as checkout, switch, and restore, and
introduces another method of viewing commit history using git reflog
rather than git log. The chapter concludes with an explanation of
patches, which capture and allow changes to a code base to be shared,
applied or reviewed.

28 ȱ 80
Chapter 1: Fundamentals

Unit 2.1
Undoing and changing
learnapply.org/git/2.1

2.1.1 Undoing a commit


If mistakes were made in the changes committed to a local or remote
repository, rewinding the changes is d using git revert. It undoes a
commit and preserves its version history.
git revert creates a new commit based on the inverse of the changes
of the commit with the mistakes.

Code 13 Common use cases of git revert

Example Description
Undoes the changes of the last
git revert HEAD
commit
git revert
Undoes a certain commit
commit_hash

2.1.2 Changing commits


The command git commit --amend modifies the previous commit by
adding the changes in the staging area to it.
The following is an example.

Code 14 The programmer is editing 2 files and forgets to commit 1 of


them

1. git add file1


2. git commit

the programmer realizes they forgot to commit the second


file

3. git add file2


4. git commit --amend
80 ȱ 29
Chapter 6: Advanced and Additional Topics

As a best practice when working with a team, don't change the


commits other programmers have based their work on to avoid merge
conflicts.

2.1.3 Undoing changes


git reset undoes changes.

Code 15 Common use cases of git reset

Example Description
git reset Resets the current branch to the
commit_hash specified commit
git reset –- Resets the current branch to the
hard specified commit and changes the
commit_hash working directory
Resets the current branch to the
git reset @~n state it was in at the previous
commit
1. git reset – Undoes all changes since the last
-soft HEAD~n commit. This doesn't remove the
2. git commit commit from history.
git reset -- Undoes changes added to the
hard Staging Area
Discards uncommitted changes
from the working directory and
git reset --
staging area and resets the current
hard
branch to the identified commit.
commit_hash
Subsequent commits are
discarded
Unstages files added to the
git reset --
staging area

2.1.4 Changing the name and email of the developer


To do this, first create a filter.sh file.
Code 16 Contents of filter.sh

30 ȱ 80
Chapter 1: Fundamentals

1. if [ "$GIT_AUTHOR_NAME" = "Author to Change From" ]


2. then
3. export GIT_AUTHOR_NAME= "Author to Change to"
4. export GIT_AUTHOR_EMAI
L="email.to.change.to@example.com"
5. fi

After modifying the content with the name and email, run the file

Code 17 Running filter.sh

chmod +x ./filter.sh

Return to a previous commit


Algorithm 1 Steps to return to a previous commit

1: Find the commit hash using git log


2: Detach the HEAD pointer using git checkout or git
switch
3: [Optional] Make a separate branch using git branch or
git checkout -b

Recovering from git reset

In a case where the programmer ran git reset @~n, which resets the
current branch to the state it was in n commits ago, was run and the
programmer would like to recover, follow the two steps below.

Algorithm 2 Steps to recover from a reset

1: Run git reflog or git log to find the commit hash of


the commit to go back to
2: Use git reset commit_hash

Recovering from git stash


In a case where the programmer ran git stash, and they would like
to recover from the most recent stash, use the code git stash apply

80 ȱ 31
Chapter 6: Advanced and Additional Topics

Alternatively, select which stash to recover from by following these two


steps.

Algorithm 3 Steps to recover from a stash

1: Run git stash list to see all stashes in a list


2: Select which stash to restore using git stash apply
stash{n}

Unit 2.2
Understanding checkout, switch,
and restore
learnapply.org/git/2.2

2.2.1 git checkout


The command git checkout serves different purposes.

Although it's primarily used to switch to a branch, it has other options


that allow it to serve different functions such as removing changes,
undoing them, and restoring files.
If the programmer switches to a branch that doesn't exist using git
checkout, the branch will be created.

Code 18 Common use cases of git checkout

Example Description
git checkout -b Creates a new branch and
branchname switches to it
Creates a new branch
git checkout -b
based on another branch
new_branchname
and switches to the new
other_branchname
branch
Removes all changes
git checkout –-file
made to a certain file

32 ȱ 80
Chapter 1: Fundamentals

git checkout Restores a selected file


stash@{n} -file from a stash
Creates a new branch and
git checkout -b sets its base commit to a
branchname HEAD~n commit that is n ancestors
behind the current commit
Undoes all changes made
git checkout -- . in the current working
directory
2.2.2 git switch
git switch is an alternative to checkout and can also be used to switch
to a branch. However, if the branch doesn't exist, it will be created only
if the -c option is included.

Code 19 Common use cases of git switch

Example Description
git switch
Switches to a new branch
branch_name
git switch - Switches to the previous branch
git switch -c Creates a new branch and
new_branchname switches to it

Along with git checkout, this command can be used to fix a


detached HEAD pointer, discussed on page 12.

2.2.3 git restore


git restore restores a file or folder to a previous state. It can also be
used to unstage files added to the staging area and to discard
uncommitted local changes.
Code 20 Common use cases of git restore

Example Description

80 ȱ 33
Chapter 6: Advanced and Additional Topics

Restores a file to a previous state


git restore
by discarding changes made in
file_name
the working directory.
Restores a folder to a previous
git restore
state by discarding changes
folder_name
made in the working directory
Unstages the changes added to
git restore --
the staging area and restore them
staged
to the state they were in at the
file_name
previous commit
git restore --
Creates a new branch and
source= -c
switches to it
new_branchname

Unit 2.3
Viewing commit history using git
reflog
learnapply.org/git/2.3

Reflogs (reference logs) is the name given to the mechanism by which


Git keeps track of file updates. They track where Git references were
updated in the local repository and are stored inside the .git folder.
After rewriting history using the techniques discussed starting page 21,
a reflog contains information about the old state of branches and allows
programmers to go back to a previous state if necessary.
git log will not show the history of commits that weren't referenced by
a branch or tag. git reflog solves this issue.

Code 21 Common use cases of git reflog

Example Description
git reflog Displays the reflogs made in
the local repository
git reflog show Displays the reflog entries for
branch_name the branch

34 ȱ 80
Chapter 1: Fundamentals

git reflog stash Saves the current state of the


working tree and index to the
reflog
git reflog Expires all entries from the
expire relog before the 90-day default
expiration
git reflog Deletes all entries from the
delete reflog
git reflog –- Displays the reflog with a
relative-date relative date. E.g, "2 weeks
ago"
git reflog Shows a list of all the recent
main@{0} changes to the HEAD pointer
git reflog show Shows all reflogs for the branch
HEAD the HEAD pointer is pointing to.
This is the branch the
programmer is currently
working on
git reflog show
Shows all reflogs made
--all

Reflog only provides a safety net if the changes were committed to the
local repository. All reflogs have a default expiration of 90 days that can
be extended.

Unit 2.4
Patches
learnapply.org/git/2.4

A patch is a text file containing the differences between two files. It


captures the changes made to a codebase and allows the programmer
to share, apply, or review them.
Code 22 Common use cases of patches

Example Description

80 ȱ 35
Chapter 6: Advanced and Additional Topics

git am patch_name.patch Applies patch as a


commit
git am *.patch Applies all patch files
to the tree
git format-patch Converts all commits
commit_hash since referenced
commit into patch files
git apply Applies changes from
patch_name.patch the patch file to the
current working
directory

36 ȱ 80
Chapter 3
GitHub and Merging
Changes

Outline
GitHub and merging changes, covering git commands for managing
remote repositories, integrating changes from different branches and
resolving merge conflicts. It introduces an alternative to merging and
rebasing: the git cherry-pick command. The chapter also details Pull
Requests, a key GitHub feature, explains five common collaboration
workflows, and concludes with a discussion of configuring and using
SSH connections.

80 ȱ 37
Chapter 6: Advanced and Additional Topics

Unit 3.1
Manipulating remote repositories
and merging
learnapply.org/git/3.1

3.1.1 Overview
Figure 2 Overview of Git commands for moving changes

Files are edited by the programmer in the Working Directory. To prepare


them for the next commit, they're added to the Staging Area. To save
the changes, they're committed. The changes can then be pushed to a
remote repository offered by GitHub.
In order to use remote repositories, remote repositories must first be
linked to the local repository using the command git remote add

3.1.2 git remote


git remote manages connections between the local and remote
repositories hosted on GitHub. Once a remote repository has been
linked to the local repository, changes can be pushed and fetched.

Code 23 Common use cases of git remote

38 ȱ 80
Example Description
git remote -v Lists all currently configured
remote repositories along with
their URLs
git remote add
Links a remote repository to
remote_repo_name
the local repository
url
git remote remove Deletes a remote configuration
remoe_repo_name from the local repository
3.1.3 git clone
git clone creates a local copy of a remote repository using the GitHub
URL of the remote repository. This command allows a person to work
on the code independently and contribute changes back to the original
repository.

Code 24 Common use cases of git clone

Example Description
git clone url Shows the differences between the
staged and unstaged versions of
files
git clone url Clones a Git repository from the
-b branch_name address into the given folder and
directory_path checks-out the given branch
git clone url
-b branch_name
Clones a single branch
--single-
branch

3.1.4 git push


git push updates a GitHub remote repository with the changes made
locally.

Code 25 Common use cases of git push

Example Description

80 ȱ 39
Chapter 6: Advanced and Additional Topics

git config –-global To use the name of the


push.default current local repository as the
default name of the remote
repository to which
changes are pushed
git push origin Pushes changes from the
master main local branch to the
main remote branch
git push -d
remote_repo_link Removes a remote branch
branch_name
3.1.5 git pull
git pull updates the current branch in the working directory with the
latest changes from the remote server.
However, this command may lead to merge conflicts.
To avoid this:
ƒ only start a git pull with a clean working directory
ƒ save working directory changes temporarily using git stash
or git worktree

3.1.6 git fetch


git fetch downloads new data from a remote repository but doesn't
integrate it into the current working directory. Fetching is useful to see
an overview of the changes that occurred in a GitHub repository.

Code 26 To fetch a number of commits from the GitHub remote


repository
git fetch --depth=n
3.1.7 Merging
Merging and rebasing are the main methods of integrating changes from
one branch to another. A third option is git cherry-pick, discussed in
Unit 3.2.
Code 27 To combine changes from the specified branch with the
current branch using git merge

40 ȱ 80
git merge branch_name

3.1.8 Rebasing
Rebasing modifies where a certain number of commits are located. It
can also combine and modify commits and their messages and can also
be used to reorder commits. The interactive version of rebasing opens
an interactive editor in the command line and eases these functions.
git rebase -i

Unlike merging which preserves the version control history of commits,


rebasing rewrites it. Therefore, use rebasing with caution.

3.1.9 How to resolve merging conflicts


When integrating changes from different branches using merging or
rebasing, conflicts can occur.
An example might be two programmers modifying the same code line in
different ways. Git doesn't know which version is correct and can only
leave markers in conflicted files for programmers to resolve, as
demonstrated in Figure 3.

Figure 3 Example of a conflicted area

The git diff command gives programmers the ability to see merge
conflicts.

Code 28 Common use cases of git diff

80 ȱ 41
Chapter 6: Advanced and Additional Topics

Example Description
git diff –-
Views merge conflicts against the
base
file in current branch
file_name
git diff –-
Views merge conflicts against
ours
changes made
file_name
git diff –-
Views merge conflicts against
theirs
other changes
file_name
git diff Allows the programmer to visually
compare changes between
different versions of files or
commits within a Git repository

3 methods exist for resolving merge conflicts.

Code 29 Methods for resolving merge conflicts

Method Description
git merge –- This command cancels a
abort merge. Use it to undo and
start again
git rebase -- This command cancels a
abort rebase. Use it to undo and
start again
1: git add file1
file2
2: git rebase –
In this method, conflicts
continue
are resolved and added,
or
and then the merge or the
1: git add file1
rebase is resumed.
file2
2: git merge --
continue

42 ȱ 80
Unit 3.2
git cherry-pick
learnapply.org/git/3.2

3.2.1 Overview
Using git cherry-pick programmers can select which commits to
include when integrating changes from one branch to another.
It's also useful for fixing mistakes in previous commits and in applying
changes to multiple branches.
However, it can introduce merge conflicts that must be resolved
manually and can change the commit history of a branch.

3.2.2 4 rules when using git cherry-pick


ƒ Prefer merging or rebasing when possible. Merging preserves
the complete history of both branches and rebasing creates a
clean and linear history that can be easier to manage and review
ƒ Avoid creating duplicate commits with identical content
ƒ Use git cherry-pick with the -x option since it provides a
safety net by automatically aborting the process if conflicts arise
ƒ Include a detailed commit message

3.2.3 Examples
These are examples of 4 use cases involving cherry-picking.

Algorithm 4 First use case: Deliver a bug fix to the end user as fast as
possible

Assumptions:
The production branch is the branch of the program
deployed to the public
The fix was already committed in the feature branch

80 ȱ 43
Chapter 6: Advanced and Additional Topics

1: Identify the commit that contains the fix for the bug
using git log
2: Switch to the production branch using git checkout
3: Use git cherry-pick commit_hash to apply the fix to
the production branch
4: Resolve any conflicts by editing area between right
arrow and left arrow markers in files
5: Push changes to the remote repository using git push
origin HEAD
6: Deploy changes using the development process

Algorithm 5 Second use case: Undo changes to fix errors in previous


commit

Assumptions:
There is a production branch
The fix was already committed in the feature branch

1: Identify the commit with the bug to undo using git log
2: Create a new commit with reversed changes using git
cherry-pick commit_hash
3: Resolve any conflicts by editing area between right
arrow and left arrow markers in files
4: Push changes to the remote repository using git push
origin HEAD

Algorithm 6 Third use case: Restore lost commits

1: Identify lost commits using git reflog (not git log,


as they will not be displayed)
2: cherry-pick the lost commits using git cherry-pick
commit_hash
3: Resolve any conflicts by editing area between right
arrow and left arrow markers in files
4: Push changes to the remote repository using git push
origin HEAD

Algorithm 7 Applying changes to multiple commits


First method

44 ȱ 80
1: Identify the commit or commits containing changes to
apply using git log and note down the commit hash or
hashes
2: Run git cherry-pick commit_hash for each commit

Second method

1: Identify the range of commits using git log to find


the hashes of the first and last commits in a range
2: Run git cherry-pick
first_commit_hash..second_commit_hash

Unit 3.3
Understanding GitHub Pull
Requests
learnapply.org/git/3.3

3.3.1 Overview
Pull Requests, not to be confused with the git pull command, are
initiated on GitHub, not the command line. When a programmer starts a
Pull Request, they're proposing a set of changes for other team
members to test, review, and provide feedback on.
If the decision to implement the changes is taken, the maintainers of the
repository will merge them. At a minimum, either two distinct branches
or two distinct repositories are needed for a pull request.
A Pull Request has the following components:
ƒ The title and description
ƒ The commits included in the pull request
ƒ A discussion section where programmers can provide feedback
and comments
ƒ A visual view of the changes made to the code

3.3.2 Setting up a Pull Request


Algorithm 8 Steps to setup a Pull Request
80 ȱ 45
Chapter 6: Advanced and Additional Topics

1: Fork a repository using the GitHub website


2: Clone the fork to the local machine using git clone
url
3: Create a new branch using git branch branch_name
4: Make changes locally and add them using git add
5: Commit changes using git commit -m "commit_message"
6: Push changes using git push –-set-upstream origin
branch_name
7: Update the local repository by following these 5 steps
1. Find the url of the remote using git remote -v
2. Specify the new remote upstream repository to sync
fork using git remote add upstream url
3. Sync the fork using git fetch upstream. Now, commits
to the main branch will be stored in a local branch
called upstream/main
4. Switch back to the local main branch of the
repository using git checkout main
5. Merge any changes made in the original repository's
main branch that we will access through our local
upstream/main branch with our local main branch
using git merge upstream/main
8: Create a new pull request using the GitHub website

3.3.3 Best practices


ƒ Pull Requests should have one purpose and should be small to
improve understandability and ease of reviewing
ƒ The forked branch should stay up to date with the main branch
to reduce the chances of merge conflicts
ƒ Write detailed descriptions
ƒ Link to any relevant issues. If the pull request resolves an open
issue, mention this
ƒ Avoid submitting a pull request too early; test changes and
ensure they function as expected before requesting others to
review
ƒ Be patient as maintainers and other team members might take
time to review
ƒ Be open to feedback and don't disregard it

46 ȱ 80
Unit 3.4
Workflows
learnapply.org/git/3.4

3.4.1 Overview
A collaboration workflow standardizes the steps programmers in a team
follow to manage and collaborate on code when using Git and GitHub.
It encompasses practices such as branching, merging, code review,
outlining how changes are proposed, and integration of approved
changes into the main codebase.
Using a workflow helps maintain order, efficiency, and improve
collaboration.
The 5 workflows described in this subchapter introduce naming
conventions for branches and the purpose of each branch is pre-
defined.

Table 2 The different branches of collaboration workflows

Branch Description
main The deployable version of the codebase
feature For new features or bug fixes
develop Serves as a staging area for ongoing
development
release Facilitates preparation for production
releases
hotfix To address critical bugs or issues
fork A copy of the main repository created by a
programmer

These workflows are a starting point and teams can create their own
based on the needs and requirements of a project.

3.4.2 The Centralized workflow

80 ȱ 47
Chapter 6: Advanced and Additional Topics

The centralized workflow, also referred to as the basic workflow, begins


with a single central repository. Programmers clone the repo to make
changes locally. Then, they continuously push their changes and pull
other programmers' changes from it.

Potential conflicts can occur when multiple programmers try to push


changes simultaneously.

Figure 4 Overview of the centralized workflow

3.4.3 The Feature Branch workflow


This workflow allows programmers to work in isolation from the main
codebase. This prevents conflicts with the main branch and ensures its
stability. In this workflow, a new feature branch is created for every new
feature or bug fix.
Pull requests or merges are used to integrate completed features or bug
fixes back into the main branch and this creates a continuous
development (CD) process.
Once ready, the new feature is pushed to the GitHub remote repository.
It's then reviewed and tested by other members. If it passes the tests,
it's merged into the main branch. Once it's been integrated the feature
branch can be deleted.
This workflow enables concurrency which allows different programmers
to work on different features of a project at the same time.
The development model involves only two branches: the main branch
and one or more feature branches.

48 ȱ 80
Figure 5 Branches of the Feature Branch workflow

3.4.4 The GitFlow workflow


This workflow is an extension of the previous Feature Branch workflow.
Although the purpose of the feature branch is the same, GitFlow
introduces several new branches and naming conventions for them.
The hotfix branch is to address critical bugs or issues. The release
branch is to facilitate preparation for production releases. The develop
branch serves as a staging area for ongoing development since code
needs to be continuously maintained and developed. The main branch
is for the deployable version of the codebase.
This workflow is suitable for projects with clearly distinguishable
development and release phases.

Figure 6 Branches of the GitFlow workflow

3.4.5 The GitHub Flow workflow


This workflow is a simpler version of the previous GitFlow workflow. The
release and hotfix branches are removed but the main, feature, and
develop branches are kept.
This workflow takes into account GitHub's Pull Requests feature. It's
suitable if the programmer is using GitHub as the remote server for Git
projects. Programmers work on feature branches and submit pull
requests to the main branch directly.

80 ȱ 49
Chapter 6: Advanced and Additional Topics

Figure 7 Branches of the GitHub Flow workflow

GitHub Flow encourages smaller, more frequent releases and attempts


to shorten the complexity and duration of feature branches,
consequently, similar to the Feature Branch workflow, it focuses on
continuous delivery (CD).

Algorithm 9 Steps of the GitHub Flow workflow

1: Create a feature branch


2: Work on a feature
3: Push the feature branch and create a GitHub Pull
Request
4: The Pull Request is reviewed by other team members
5: If it passes the review, it will be integrated
6: Delete the feature branch

3.4.6 The Forking workflow


This workflow creates a new version of a repository that's independent
to the programmer. This is done by forking and cloning the fork. It allows
for a decentralized development model that permits experimentation
with forks before proposing changes to the original repository. This
decentralized approach reduces the risks of conflicts in the main
repository.
This workflow adds a fork branch to GitHub Flow's main, feature, and
develop branches.
If implemented, following this workflow requires 8 steps:

Algorithm 10 Steps of the Forking workflow

50 ȱ 80
1: Fork the main repository
2: Clone the fork to the machine
3: Create one or more feature branches for additional
features and fixing bugs
4: Make changes
5: Push the branch with the changes to the remote
repository
6: Create a pull request
7: The pull request is reviewed and tested by the team
8: If it passes the test, the changes in the pull request
are merged

Figure 8 Branches of the Forking workflow

Unit 3.5
Understanding SSH connections
learnapply.org/git/3.5

3.5.1 Overview
This book discussed using URLs within the command line to access
GitHub's services and remote repositories. Secure Shell (SSH) is an
alternative method. SSH uses strong encryption to protect data from
being intercepted and is considered safer than https links.
When setting it up, two keys are created: a public key and a private one.
The public key is shared with the remote server. It's used to verify the
programmer's identity. The private key is kept a secret.

80 ȱ 51
Chapter 6: Advanced and Additional Topics

3.5.2 Setting up an SSH key


Algorithm 11 Steps for setting up an SSH key for Git and GitHub

1: Open Git Bash and run ssh-keygen


2: Add key to Git Bash by running these two commands
eval `ssh-agent -s ` ᶮMake sure you use ` and not
'
ssh-add ~/sshkey
3: See the key using cat sshkey.pub and copy it somewhere
safe
4: Go to SSH and GPG Keys section of GitHub account
settings
5: Set a new SSH key and select authentication as the key
type

3.5.3 Examples
Code 30 Examples of SSH in the command line

Example Description
git clone
git@github.com:[GitHub Clone a new repository
username]/[repo using SSH
name].git
git remote set-url
origin Change an existing
git@github.com:[GitHub repository from https to
username]/[repo SSH
name].git

52 ȱ 80
Chapter 4
Cleaning,
Customization,
and Correcting
Errors

Outline

This chapter covers creating custom abbreviations for Git commands,


finding lost files, lost commits and correcting errors. It also provides
instructions on cleaning up files and repositories to improve
performance and shows how to disable Git tracking for specific files and
folders.

80 ȱ 53
Unit 4.1
Custom abbreviations for Git
commands
learnapply.org/git/4.1

An alias is an abbreviation defined by the programmer for a longer Git


command. They improves efficiency and simplify common workflows.
Aliases are defined in the Git configuration file, .gitconfig.

Code 31 Shortcuts for shortening commit to ci and unstaging staged


files using git unstage

Before After
git config –-alias.ci git ci -m
"commit" "commit_message"
git config –- git unstage
alias.unstage "reset -–"

Code 32 To list all existing aliases

git config --get-regexp '^alias\.

Unit 4.2
Correcting errors
learnapply.org/git/4.2

4.2.1 Finding lost files and commits

Code 33 To list all lost files and commits

git fsck –-lost-found

1 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

Code 34 To check for errors and clean the repository by removing all
unreachable and loose objects

1. git fsck
2. git gc --prune

4.2.2 Finding errors


Algorithm 12 Steps the commit that introduced a bug

1: Start a binary search session using git bisect start


2: Give the session two references: a good commit before
the bug using git bisect good commit_hash and a bad
commit after the bug using git bisect bad commit_hash or
git bisect bad HEAD

The session will start, and Git will find where the bug
was introduced

3: End the session using git bisect reset

4.2.3 Tools to correct errors


The debugging programs WinMerge and Meld are alternatives to the
git bisect command:
Windows winmerge.org
Windows, macOS, Linux meldmerge.org

Unit 4.3
Cleaning files and repositories
learnapply.org/git/4.3

git clean removes untracked files and directories from the working
directory.

͗͏ϙǤϙ2
An untracked file or folder is one that is present in the working directory
but isn't part of the local repository, remote repository, or staging area.
Its changes and versions are untracked by Git.

Code 35 Common use cases for cleaning files and directories

Example Description
git clean -i Cleans files and folders
interactively
git clean -f Removes all untracked files
git clean -fX Cleans ignored files from the
current folder and all subdirectories
git clean -fd Removes all untracked directories
and the files within them
git clean -dn Previews all directories that will be
cleaned
1. git fetch Removes tracking between local
–p and deleted remote branches. The
2. git branch second command will display which
-vv branches are no longer being
tracked. The word "gone" indicates
they're no longer being tracked

Unit 4.4
Disabling Git's tracking
learnapply.org/git/4.4

An ignored file will not be:


ƒ Displayed in the command line results of commands such as
git status and git diff
ƒ Added to the staging area or committed using git add or git
commit
There exist multiple methods of removing a file from Git's tracking.

Code 36 Common use cases for cleaning files and directories

3 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

Example Description
git config –global
Ignores certain files and
core.excludesfile
folders on a global basis
.gitignore_file_path
git rm –-cached Ignores a file that was
file_name already committed to a Git
repository
git update-index -- Ignores subsequent
assume-unchanged changes to a file without
file_name removing it from the
repository
git update-index –-
Ignores changes in tracked
skip-worktree
files
file_name
git status --ignored Finds all files in the current
folder ignored by a global
.gitignore file
git check-ignore Checks if a certain file is
file_name ignored

Figure 9 Example the of contents of the .gitingore file

For templates of .gitignore files with generally accepted exceptions for


different programming languages, operating systems, and other
programming tools, visit the following websites
gitignore.io
github.com/github/gitingore

͗͏ϙǤϙ4
Chapter 5
GitHub Actions
and GitHub Pages

Outline
This chapter describes two GitHub features: Actions and Pages.

1 Ǥϙ͗͏
Chapter 5: GitHub Actions and GitHub Pages

Unit 5.1
Understanding GitHub Actions
learnapply.org/git/5.1

5.1.1 What is CI/CD?


Continuous Integration (CI) refers to programmers continuously
integrating the changes they make to code files into the project.
Continuous Development (CD) extends CI by automating the
deployment of the changes to production.
CI/CD is a software development practice that should be used when
developing large-scale programs rather than one with a small user base.
GitHub Actions is one of many available CI/CD tools. For a full list, visit
github.com/cicdops/awesome-ciandcd

5.1.2 What is a GitHub Action?


A GitHub Action is a reusable piece of code that automatically runs in
response to events in the remote repository hosted on GitHub. They're
used to automate tasks, such as building, testing, validating, and
deploying code. They reduce development time and improve code
quality.
Actions are configured in YAML files, which take either .yaml or .yml as
file extensions, and they're placed inside the .github/workflows subfolder
in a remote repository.
In addition to the built-in Actions found in
github.com/actions
Individuals and teams can publish their actions on the public
marketplace for others to use. Find them at
github.com/marketplace?type=actions

5.1.3 Components and features of GitHub Actions


The 3 main components of a GitHub Action are:
1 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

ƒ Workflows
ƒ Jobs
ƒ Steps

Workflows define the overall automation process. They consist of one


or more jobs. They're triggered by events such as pushing changes, pull
requests, or scheduled tasks.
Jobs are the individual tasks within a workflow. They execute steps to
complete an assigned task. They can run either in parallel or
sequentially depending on the workflow configuration. GitHub provides
Virtual Machines (VMs) for programmers to choose from for running
jobs. In the context of GitHub Actions, VMs are called runners.
Steps are the individual actions within a Job. One step performs one
task. These actions are either built-in, provided by other programmers
or developed personally. The output of each step can be used as an
input for subsequent steps within the same job.
GitHub Actions provides additional customizations that a programmer
may use.

Table 3 Features provided by GitHub Actions

Feature Description
Conditions Control job execution based on
triggers. For example, certain
changes in files
Matrices Run jobs with different configurations
simultaneously to test various
scenarios
Concurrency Limits the number of parallel jobs to
manage resource usage efficiently
Environments Different environment variables for
different jobs and steps can be
defined
Containers Run jobs inside containers such as
the ones provided by Docker
Secrets Store sensitive information such as
passwords and PATs
Re-runs For re-running certain jobs or
workflows if needed
͗͏ϙǤϙ2
Chapter 5: GitHub Actions and GitHub Pages

Algorithm 13 How a GitHub Action is executed

1: First, an event triggers the workflow


2: The workflow assigns individual jobs based on its
configuration
3: Job execution on the chosen Virtual Machine
4: If it's going to be used, the output of each Step is
available for subsequent steps within the same job
5: The workflow finishes when all jobs have been
completed

Unit 5.2
Understanding GitHub Pages
learnapply.org/git/5.2

GitHub Pages is a service for static site hosting. Static sites don't
generate pages for programmers in real-time and only use HTML, CSS,
and JavaScript files from a GitHub repository.
GitHub Pages runs those files through the build process and provides
the programmer with a GitHub URL for the website.
If configuring a personal domain instead, the programmer will need to
set up a CNAME record with the domain registrar in the DNS settings.
When editing the CNAME record, the name is the domain bought, and
the value is the URL provided by GitHub Pages.
There are 3 types of GitHub pages:
ƒ Project: The websites are connected to a certain project
repository hosted on GitHub
ƒ User and Organization: The websites are connected to a
certain GitHub account

3 Ǥϙ͗͏
Chapter 6
Advanced and
Additional Topics

Outline
The Advanced and Additional topics chapter will begin with an overview
of GitHub Desktop, then it will explore hooks, submodules, subtrees and
bundles. It also introduces the git archive command for compressing
different Git items into a ZIP file. The chapter concludes with best
practices to follow when using GitHub and Git, and an explanation of
GitHub's README section.

1 Ǥϙ͗͏
Unit 6.1
GitHub Desktop
learnapply.org/git/6.1

GitHub Desktop is a program developed by GitHub. Rather than use Git


Bash or the command line, it provides a graphical user interface for
managing the interaction between local and remote repositories hosted
on GitHub.
Windows, macOS desktop.github.com
It helps with the following functions:
ƒ Creating new branches
ƒ Merge branches with the main branch
ƒ Push, pull, and fetch changes
ƒ Compare and rename branches
ƒ Discard and stash changes
ƒ Squash and merge commits into the current branch
ƒ Rebase the current branch
ƒ Create and preview GitHub Pull Requests

The program is demonstrated in the video for the unit.

Unit 6.2
Custom hooks
learnapply.org/git/6.2
Similar to GitHub Actions, hooks are scripts that automatically run if a
certain event or action triggers them. Hook files have pre-determined
names that can't be modified. They don't take file extensions and must
be placed inside the .git/hooks subfolder in a Git repository.
Scripts are either server-side or client-side.

6.2.1 Server-side scripts


Server-side scripts are triggered by network operations such as
receiving pushed commits.

1 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

Table 4 Examples of server-side Git hooks and their purpose

Script Description
update Triggered after an update to the
repository
post-commit Executed after a commit is made. It's
usually used to notify the Git
programmers
post- For notifying Git programmers. It's
receive executed after a push is received
pre-commit Triggered before a commit is made
and it's usually for running automated
tests to make sure the commit won't
break the project
pre-commit- Triggered before the commit message
msg editor is opened
pre-rebase Executed before a rebase has started.
Usually used to make sure the rebase
is appropriate
pre-receive Executed before a push is received

6.2.2 Client-side scripts


These scripts are triggered by normal operations such as committing
and merging.
An example is pre-push

It's triggered before a push is made to another repository. It's usually


used to prevent the push from reaching the remote repository.
For additional detail about Git hooks, visit
git-scm.com/docs/githooks

Unit 6.3
Submodules and Subtrees

͗͏ϙǤϙ2
learnapply.org/git/6.3

Submodules and subtrees are methods of embedding a Git repository


inside a different Git repository. They're used to manage the code
dependencies of a project.

Table 5 Differences between submodules and subtrees

Submodules Subtrees
A submodule acts as a Subtrees embed the entire
link to external contents of another
repositories repository, including its
history, into the main
repository
A submodule keeps the A subtree increases the size
main repository size of the main repository
small as it only stores significantly as it only
the link to external code includes all files and the
history of the subproject

The command git submodule is used to manage submodules.

Code 37 Common use cases of git submodule

Example Description
git submodule update -- Pulls all
recursive --remote submodules from
their respective
remote
repositories
git submodule add url Adds a new
local_folder_path submodule to the
local repository
1. git submodule deinit -f
--name submodule_name Deletes a
2. rm -rf submodule from
.git/modules/submodule_name the repository
3. git rm -f submodule_name

3 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

git submodule update --init Clones missing


--recursive submodules and
checkout commits

Unit 6.4
Bundles
learnapply.org/git/6.4
Bundles help programmers transfer repositories to machines that have
no internet connection. They allow the packaging of all Git objects and
references of a repository into a bundle that can be transferred to
another machine via a USB drive for example. Their file extension is
.bundle.

Code 38 Creates a bundle file that can be transferred to another


machine

git bundle create bundle_name.bundle

Unit 6.5
Creating archives
learnapply.org/git/6.5

An archive contains files and folders of a Git repository, branch, or tag


packaged in a .zip file. It's similar to compressing using WinRAR or the
built-in Windows ZIP tool.
An archive allows the sharing of the entire codebase at a certain point
in time without needing a full Git clone.
Code 39 Common use cases of git archive

Example Description
git archive --
Creates a ZIP archive of the
format zip HEAD >
current branch
archive-HEAD.zip

͗͏ϙǤϙ4
git archive --
output=archive- Creates a ZIP archive of a
archive_name – certain tag. The name of the
prefix=src- archive and tag must be
directory=name defined
tag_name
git archive --
output=archive- Creates a ZIP archive of a
archive_name – local branch. The name of the
prefix=src- archive and local branch
directory=name must be defined
local_branch_name
git archive --
output=archive- Creates a ZIP archive of a
archive_name – remote branch. The name of
prefix=src- the archive and remote
directory=name branch must be defined
remote_branch_name

Unit 6.6
Best practices and GitHub's
README section
learnapply.org/git/6.6

6.6.1 Managing branches


To manage branches effectively, keep them focused on accomplishing
a certain task such as adding a new feature or fixing a bug.
Best practices for managing branches effectively include:
ƒ Regularly update branches
ƒ Give the branches meaningful names
ƒ Ensure branches serve a certain purpose such as adding a new
feature or fixing a bug
ƒ Delete merged branches
ƒ Use GitHub's Protection Rules, they ensure certain workflows for
one or more branches such as requiring and approving a review
of code changes
5 Ǥϙ͗͏
Chapter 6: Advanced and Additional Topics

6.6.2 Organizing repositories


Best practices for organizing repositories include:
ƒ Use a clear and descriptive naming convention
ƒ Group related files into meaningful folders
ƒ Create a README file detailing the purpose of a repository
ƒ Use tags for separate releases
ƒ Squash commits before merging branches
ƒ Write good commit messages
ƒ Use issue trackers to manage bush and feature requests
ƒ Use Git Large File Storage (LFS) for Large Files

6.6.3 The README section


The README.md file is placed within the main folder of a remote
repository. It contains markdown code that is compiled to generate an
organized section at the end of a GitHub repository's main page.
Maintainers of a project usually use it as an area to mention important
information about a project such as installation instructions,
explanations, and other miscellaneous information.
The following is the README section of PyTorch, an open-source
machine-learning framework developed by Facebook.
github.com/pytorch/pytorch#readme

͗͏ϙǤϙ6
Appendix

Appendix
learnapply.org/course/final

Outline

The appendix provides additional programming and research


resources. It also briefly explains the Reed-Solomon error correction
codes, which are used in cryptography. These codes facilitate the
recovery of QR codes. The resources used to create this book and its
video course are listed, as well as common Linux command line
operations.

The book ends with Learn and Apply’s other courses, books, and series.

7 Ǥϙ͗͏
Appendix

Additional resources
Practice makes perfect. Apply the contents of this book to a personal
project and attempt to use GitHub and Git in all future software
development, regardless of programming language.

For details on available options for Git commands and GitHub’s


features, visit the official documentations:
git-scm.com/docs
docs.github.com
Additional documentation websites:
overapi.com
devdocs.io
Forums to ask programming questions and request help correcting
errors:
stackoverflow.com
support.github.com
Other resources:
github.com/dictcp/awesome-git
github.com/compscilauren/awesome-git-hooks
github.com/stevemao/awesome-git-addons
github.com/git-tips/tips
github.com/arslanbilal/git-cheat-sheet
github.com/matchai/awesome-pinned-gists
github.com/tiimgreen/github-cheat-sheet
github.com/stefanbuck/awesome-browser-extensions-for-github
github.com/cicdops/awesome-ciandcd

In general, if you would like to learn more about a programming tool or


concept, search GitHub Awesome followed by its name.
For example, you can also find more tools, frameworks, APIs, and
libraries for GitHub and Git on the GitHub Awesome repository:

͗͏ϙǤϙ8
Appendix

github.com/dictcp/awesome-git
Platforms for open-source projects and developer tools:
sourceforge.net
github.com
Discounts are regularly offered for commercial products.
Using their school's email address, students can apply for a price
reduction or free access to various programming tools and benefits
through programs such as the GitHub Developer Pack, or by contacting
the developers directly.

Table 6 Additional resources


Resource Description
Hugging Face A platform for Artificial Intelligence
huggingface.co (AI) projects
Kaggle
An alternative AI platform
kaggle.com
Google Gemini
A Large Language Model (LLM)
gemini.google.co
for content generation
m
Microsoft Copilot
copilot.microsoft. An alternative LLM by Microsoft
com
ChatGPT
An alternative LLM by OpenAI
chat.openai.com
massCode
A code snippets manager
masscode.io
Google Books
Ngram Viewer Tracks the frequency of words and
books.google.co phrases in millions of books
m/ngrams
Google Trends
Reveals popularity of key words
trends.google.co
searched on Google
m
Obsidian
Stores thoughts and ideas
obsidian.md
LogSeq
An alternative to Obsidian
logseq.com
A search engine for research
Google Scholar
papers

9 Ǥϙ͗͏
Appendix

scholar.google.co
m
An archive for millions of open-
ArXiv
access research papers and
arxiv.org
preprints by Cornell University
ArXiv-Sanity
papers Provides an alternative interface
arxiv-sanity- for ArXiv
lite.com
CatalyzeX Provides code implementations
catalyzex.com for most ArXiv papers
PapersWithCode
A portal for Artificial Intelligence
paperswithcode.c
papers, their code, and datasets
om
IEEE Xplore
ieeexplore.ieee.or
g/Xplore/home.jsp

ACM Digital
Library
dl.acm.org

Science Direct
sciencedirect.com
A list of databases containing
JSTOR research papers on various fields
jstor.org and topics

Scopus
scopus.com

Web of Science
webofscience.co
m/wos

DOAJ
doaj.org
Google Public
Data Visualizes publicly available
google.com/publi datasets
cdata
TensorBoard by
Provides visualizations and tools
TensorFlow
needed for Artificial Intelligence
tensorflow.org/ten
experiments
sorboard
͗͏ϙǤϙ͐͏
Appendix

Connected Papers
Provides a visual graph to see
connectedpapers.
connections between papers
com
Dimensions Visualizes networks of papers to
app.dimensions.ai discover connections between
/auth/base/landing them
Aim An Artificial Intelligence-based
aimstack.io open-source experiment tracker
Phind Artificial Intelligence-based search
phind.com engine and pair programmer
Perplexity.ai
An alternative AI search engine
perplexity.ai
Elicit Analyzes research papers and
elicit.com summarizes them
Data Version An open-source version control
Control system for Data Science and
dvc.org Artificial Intelligence projects
InterviewBit Provides free interview questions
interviewbit.com and their solutions
AlgoExpert A paid resource for interview
algoexpert.io questions and their solutions
MLflow Tracking Provides an API to see detail and
mlflow.org/docs/la visualize the results of Artificial
test/tracking.html Intelligence experiments
Provides a platform to run the
ClearML
entire Artificial Intelligence
clear.ml
lifecycle
DAGsHub An open-source collaboration
dagshub.com platform for Data Science
An Artificial-Intelligence
Krater.ai
application for content creators
krater.ai
and writers
Chat with Open A project that benchmarks the
LLMs accuracy of responses of LLMs to
chat.lmsys.org queries

As additional readings, the book Version Control with Git by Prem


Kumar Ponuthorai provides more detail on GitHub and Git.
amzn.com/1492091197

The book Git Project Management for Developers and DevOps Teams
by Jon Loeliger provides visualizations of concepts and additional
commands and options for Git. It also covers GitLab, another remote
service for Git projects.
11 Ǥϙ͗͏
Appendix

amzn.com/1493222899

For more details and other resources, search on Google, Bing,


YouTube, etc.
Reed-Solomon error correction (QR codes)
Error correction refers to the automatic detection and correction of errors
in data. Errors happen during the incorrect transmission of data or from
data corruption.

To generate QR codes, the authors used the extension QR4Office for


Microsoft Word and the website qrbatch.com

The algorithm of Reed-Solomon systems adds extra bits to QR codes


for them to be corrected if they’re corrupted.

Figure 10: A typical Reed-Solomon system

In a Reed-Solomon system, the encoder takes digital data as input and


adds redundant bits to it (in the form of symbols) to ease the recovery
process if it’s corrupted.

Errors happen due to noise, interference, and scratches. In the case of


QR codes, they can be corrupted from wear and tear, stains, marks,
printing in low resolution, or fading.

The decoder processes each data block and attempts to correct errors
and recover the original data. The amount of data that can be corrected
depends on the characteristics of the Reed-Solomon code.

QR4Office provides the following error correction options:


ඵ Low – 7%
ඵ Medium – 15%
ඵ Quartile – 25%
ඵ High – 30%

͗͏ϙǤϙ12
Appendix

These rates refer to the Error Correction Level (ECL) and represent the
maximum percentage of data that can be corrected in case of errors.

During the encoding process, mathematical algorithms and concepts,


such as Galois fields, determine the length of these symbols and where
they’re added. Galois fields are foundational to cryptography in general
and error correction and Reed-Solomon in particular.

For more detail, read the research paper Galois Field in Cryptography
by Christoforus Juan Benvenuto:
sites.math.washington.edu/~morrow/336_12/papers/juan.pdf

References
Atlassian. (n.d.). Git Tutorials and Training | Atlassian Git, Tutorial.
Atlassian from
atlassian.com/git/tutorials

awesome-cheatsheets/tools/git.sh at master LeCoupa/awesome-


cheatsheets. (2023, December 21). GitHub from
github.com/LeCoupa/awesome-
cheatsheets/blob/master/tools/git.sh

Don, E. (2023). Git prodigy: mastering version control with Git and
Github.

Free Git Book. (2023, December 21). Books.goalkicker.com from


books.goalkicker.com/GitBook

Git Bash from


git-scm.com

Git Cheat Sheet. (2023, December 21) from


cheat-sheets.org/saved-copy/github-git-cheat-sheet-20220806.pdf

Git Cheat Sheet. (2023, December 21). GitHub from


cheat-sheets.org/saved-copy/git-cheat-sheet-v2.pdf

Git Cheat Sheet Create. (2023, December 21) from


cheat-sheets.org/saved-copy/git-cheat-sheet.pdf

Git Quick Reference. (2023, December 21) from


cheat-sheets.org/saved-copy/Git_Quick_Reference.2011-09-04.pdf
13 Ǥϙ͗͏
Appendix

Git Tutorial. (2023, May 2). GeeksforGeeks from


geeksforgeeks.org/git-tutorial

Git Tutorial. (2023, December 23) from


w3schools.com/git

Google AI. (2024). Gemini [Large Language model] from


gemini.google.com

Homebrew from
brew.sh

Lodha, K. (2023, January 31). Git Describe. Scaler Topics from


scaler.com/topics/git/git-describe

Microsoft. (2024). Copilot [Large Language Model] from


copilot.microsoft.com

OpenAI. (2023). ChatGPT [Large Language Model] from


chat.openai.com/chat

reed-solomon codes. (2019). Cmu.edu from


cs.cmu.edu/~guyb/realworld/reedsolomon/reed_solomon_codes.
html

STAGE & SNAPSHOT. (2023, December 21) from


cheat-sheets.org/saved-copy/git-cheat-sheet-
education.20211117.pdf

Top 20 Git Commands With Examples - DZone. (2023, December 21).


Dzone.com from
dzone.com/articles/top-20-git-commands-with-examples

Visual Studio Code from


code.visualtudio.com

List of command line operations in Linux


The following is a comprehensive list of the most commonly used
commands in the Linux command line. Most of these operations have
arguments for different tasks. Research the commands of interest for
more detail.

͗͏ϙǤϙ14
Appendix

sudo
ᶮTo give the current user root access (the equivalent of
'Run as Administrator’ in Windows). This is often used
with commands that require access to the file system.

apt
ᶮTo manage packages on Debian-based Linux systems

snap
ᶮTo manage snap packages

apropos
ᶮTo find all command line commands containing a certain
keyword

man
ᶮTo display the manual page for a certain command line
command

whatis
ᶮTo provide a brief description of a command line command

cd
ᶮTo navigate between folders

ls
ᶮTo list all files and folders located in the current
folder

mkdir
ᶮTo create a new folder inside the current folder

touch
ᶮTo create a new file inside the current folder
15 Ǥϙ͗͏
Appendix

pwd
ᶮTo display the name of the current folder

tail
ᶮTo display the last lines of a file

head
ᶮTo display the first lines of a file

diff
ᶮTo compare the content of 2 files line by line and display
the differences between them

uniq
ᶮTo filter duplicate lines in a file

cmp
ᶮTo test if 2 files are identical or not

comm
ᶮTo compare 2 sorted files and display the lines common
to both

chmod
ᶮTo change the permissions of a file or folder

sudo find
ᶮTo search for files in the system

lsattr
ᶮTo list the properties of a file

͗͏ϙǤϙ16
Appendix

chattr
ᶮTo change the properties of a file

open
ᶮTo open a file located in the current folder

cat
ᶮTo print the contents of a small file in the command line

less
ᶮTo print the contents of a large file in the current
folder

cp
ᶮTo copy and paste files and folders from one folder to
another

rm
ᶮTo delete a file or folder in the current folder

nano
ᶮTo create and open a new file inside the current folder

grep
ᶮTo find text in a file located in the current folder

echo
ᶮTo write text to a file

mv
ᶮTo move or rename files and folders

17 Ǥϙ͗͏
Appendix

history
ᶮTo view all previously executed commands in the current
session of the command line

ping
ᶮTo verify whether a network host is reachable or not

ssh
ᶮTo connect to a remote system

w
ᶮTo display information about the users currently logged
in

uptime
ᶮTo see how long the system has been running

free
ᶮTo display information about the system’s memory usage

du
ᶮTo display the disk space usage of files and folders

df
ᶮTo display information about the disk space usage of the
system

mkfs.ext4
ᶮTo create a new ext4 filesystem on a disk partition or
separate disk

1. sudo mount
2. sudo fsck
3. sudo unmount

͗͏ϙǤϙ18
Appendix

ᶮTo recover and repair a filesystem. The file system must


first be mounted. At the end, it must be unmounted

zip
ᶮTo create a zip file

gzip
ᶮTo create a gzip file

unzip
ᶮTo extract a zip file in the current folder

gunzip
ᶮTo extract a gzip file in the current folder

watch
ᶮTo repeatedly run a certain script or command at a fixed
time interval

sleep
ᶮTo introduce a delay before the execution of a script or
command

dd
ᶮTo copy files from one folder to another. This command
can also be used to convert between different file types

rsync
ᶮTo transfer folders between two locations

sync
ᶮTo ensure all pending data is written to storage

19 Ǥϙ͗͏
Appendix

chown
ᶮTo change the file owner or group

chgrp
ᶮTo change the group ownership of a file or folder

env
ᶮTo list environment variables

alias
ᶮTo create shortcuts for commands

whereis
ᶮTo locate the executable and binary files of a command

groupadd
ᶮTo create a user group

members
ᶮTo list members of a group

groupmod
ᶮTo modify the properties of a group

groupdel
ᶮTo delete a user group

usermod
ᶮTo modify the properties of a user

dump
ᶮTo create backups of files or file systems

restore
͗͏ϙǤϙ͑͏
Appendix

ᶮTo restore backups

source
ᶮTo execute a shell script that’s located in the current
folder

jobs
ᶮTo list all background jobs in the current session

ps
ᶮTo list all running processes

top
ᶮTo see a real-time view of all processes

htop
ᶮTo see an interactive view of all processes

kill
ᶮTo kill the process of a program

kill -9
ᶮTo force kill a program process

killall
ᶮTo kill all processes of a program

clear
ᶮTo clear the command line of anything displayed on it

exit
ᶮTo exit the command line

21 Ǥϙ͗͏
Appendix

Other courses and books of Learn and Apply


The GitHub and Git: A Guide course and book are part of the
Programming series. The series covers Artificial Intelligence, Python,
JavaScript, C++, Databases, App Development, and other subjects.

Learn and Apply’s platform includes other series such as Finance and
Accounting, Mathematics and Statistics, Sciences, Humanities, and
Languages.

LearnApply.org

The content is available in different languages; the courses, books, and


audiobooks with the symbol ȕ, were translated and had their audio
generated using Artificial Intelligence-based tools.
To improve those translations and voice-overs or to help with new
languages:
learnapply.org/translate

To request support on a personal project, stay in touch, and receive


updates on new course and book releases, join Learn and Apply’s
communities on Reddit and Discord and subscribe to the e-mail
newsletter:
learnapply.org/community

To donate and help us cover advertisement, translation, printing, and


other costs:
dridi.org/donate

Learn and Apply is an education project produced by The Dridi


Foundation. The foundation's projects are dedicated to the greater
economic and social good of humanity.
dridi.org

͗͏ϙǤϙ22
*LW+XE
EDQG
G*LW
$
$*XLGH
Š‹•„‘‘‡š’Žƒ‹•‘•––‘’‹ •”‡Žƒ–‡†–‘ ‹– —„ƒ†–Ї ‹–
˜‡”•‹‘ ‘–”‘Ž•›•–‡Ś –ƒŽ•‘†‡• ”‹„‡•ƒ› ‹– ‘ƒ†•
ƒ††‡–ƒ‹Ž• ‘‘—•‡ ƒ•‡•ƒ†‘’–‹‘•

”‡˜‹‘—•‡š’‡”‹‡ ‡™‹–Š ‹– —„‘” ‹–‹•Ũ–”‡“—‹”‡†

Ї„‘‘ƒŽ•‘‡š’Žƒ‹•–Ї„‡‡ˆ‹–•‘ˆ—•‹‰ ‹––‘ƒƒ‰‡ ‘†‡


ˆ‹Ž‡•ř•— Šƒ•„”ƒ Š‹‰ƒ†Š‹•–‘”›ƒƒ‰‡‡–

‘‡‘ˆ–Ї‰‹– ‘ƒ†• ‘˜‡”‡†

ƒ ‰‹–‹‹– ƒ ‰‹–˜ ƒ ‰‹–†‹ˆˆ ƒ ‰‹–”‡•–‘”‡


ƒ ‰‹–•–ƒ–—• ƒ ‰‹–” ƒ ‰‹–„Žƒ‡ ƒ ‰‹–”‡‘–‡
ƒ ‰‹–ƒ†† ƒ ‰‹–Ž‘‰ ƒ ‰‹–•Š‘™ ƒ ‰‹– Ž‘‡
ƒ ‰‹– ‘‹– ƒ ‰‹––ƒ‰ ƒ ‰‹– Ї ‘—– ƒ ‰‹–’—•Š
ƒ ‰‹–„”ƒ Š ƒ ‰‹–†‡• ”‹„‡ ƒ ‰‹–•™‹– Š ƒ ‰‹–’—ŽŽ

‹– ƒ „‡ —•‡† ™‹–Š ”‡‘–‡ ”‡’‘•‹–‘”‹‡• –‘ ˆƒ ‹Ž‹–ƒ–‡


–‡ƒ™‘”ƒ† ‘ŽŽƒ„‘”ƒ–‹‘
‹– —„ ‡ƒ„އ• –Š‹• ƒ† ’”‘˜‹†‡• ƒ††‹–‹‘ƒŽ •‡”˜‹ ‡• •— Š ƒ•
 –‹‘•ƒ†ƒ‰‡•Ś ‹–ɐ• ‘˜‡”‡†•–ƒ”–‹‰Šƒ’–‡”ɪ

‡ƒ” ƒ† ’’Ž› ‹• ƒ ‘ ‹•‡ř ƒ ‡••‹„އř ƒ† ˆ”‡‡


—Ž–‹Ž‹‰—ƒŽ ‡†— ƒ–‹‘ ’Žƒ–ˆ‘” ’”‘†— ‡† „› Ї ”‹†‹
‘—†ƒ–‹‘ř ƒ ‘’”‘ˆ‹– ˆ‘—†‡† „› –Ї „”‘–Ї”• œ‹œ ƒ†
ƒŽ‹ –‘ Š‘‘” –Ї‹” ’ƒ”‡–• ”Ŝ ‹†Šƒ ”‹†‹ ƒ† ”•Ŝ ‡‹Žƒ
‡Žƒ••‹

Ї ‘—†ƒ–‹‘ɐ• ’”‘Œ‡ –• ƒ”‡ ˆ‘” –Ї ‰”‡ƒ–‡” ‡ ‘‘‹  ƒ†
•‘
›
– ‹ƒŽ‰‘‘†‘ˆŠ—ƒ‹
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
3URJUDPPLQJVHULHV
/HDUQDQG$SSO\
/HDUQ$SSO\RUJ

You might also like