Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion episodes/02-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,22 @@ No commits yet
nothing to commit (create/copy files and use "git add" to track)
```

The output tells us that we are on the main branch (more on this later) and that we have nothing to commit (no
The output tells us that we are on the main branch and that we have nothing to commit (no
unsaved changes).

::::::::::::::::::::::::::::::::::::::::: callout

## Branches and commits

Commits in Git are like snapshots of our project.
They are ordered into sequences, or "branches", with each commit pointing back to the one before it in the branch.
Git keeps track of the last commit in each branch with a special label;
in this lesson we mostly use one branch with the label "main".

![](fig/git-branch.svg){alt='The label ‘main’ points to commit c2; c2 points to its parent c1, which points to c0.'}

::::::::::::::::::::::::::::::::::::::::::::::::::

### Two steps: Adding and committing

We will now create and save our first project file. This is a two-step process. First, we **add** any files for which
Expand Down
14 changes: 14 additions & 0 deletions episodes/05-github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ it's more practical to grant everyone access to commit directly instead.

::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::: callout

## Branching and merging

Branches get their name because you can create a new one (say, "patch")
that splits off from an existing one like "main",
allowing different sets of changes to be made in parallel.
Later on, Git can take the changes from "patch" and merge (copy) them into the "main" branch.
In the last challenge, GitHub did all this for us in the background.

![](fig/git-branches.svg){alt='The label ‘main’ points to commit c5; arrows point from c5 to c3 to c1 to c0. The label ‘patch’ points to commit c4; arrows point from c4 to c2 to c1. A dotted arrow points from c5 to c4.'}

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: challenge

## Optional challenge: Contributing to a page owned by someone else (slightly more complicated way)
Expand Down
129 changes: 129 additions & 0 deletions episodes/fig/git-branch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading