From 8eff4623bb3f60d3e090d87de7dd2e27f8057027 Mon Sep 17 00:00:00 2001
From: Heerko
Archiving analogy:
Each participant will:
Check first:
git --versionIf missing:
Minimum requirement: you can run git in a terminal.
git config --global user.name "Your Name" -git config --global user.email "you@example.com"
Check:
git config --global --list
This shows up in commit metadata (provenance).
This is why Git feels "archival":
Create a repository in the current folder. -Use this when you are creating and working on your own projects.
git initCreates a .git/ directory containing history + metadata.
For the exercise we will use git clone instead of git init.
Cloen (copy) a repository in the current folder.
git clone https://git.hackersanddesigners.nl/hrk/braids <destination>
Downloads a repo from the web, complete with the full commit history and all changes.
git statusShows:
Stage files for the next commit.
git add index.html -git add assets/
Stage everything (use carefully):
git add .
Staging is curatorial: select what belongs together.
git commit -m "Added name to my page"
Good commit message pattern:
git log --oneline --graph
Gives a quick "finding aid" of earlier commits. Press 'q' to exit.
List branches:
git branchCreate a branch:
git branch people/yourname
Switch to branch:
git checkout people/yourname
Shortcut (create + switch):
git checkout -b people/yourname
Branches are parallel dossiers: safe space for changes.
Push your branch to the server:
git push -u origin people/yourname
Pull updates from server:
git pullDuring the exercise you mostly push your branch. +- Forgejo / Gitea (self-hosted)
Each participant will:
Check first:
git --versionIf missing:
Minimum requirement: you can run git in a terminal.
This is why Git feels "archival":
Create a repository in the current folder. +Use this when you are creating and working on your own projects.
git initCreates a .git/ directory containing history + metadata.
For the exercise we will use git clone instead of git init.
Cloen (copy) a repository in the current folder.
git clone https://git.hackersanddesigners.nl/hrk/braids <destination>
Downloads a repo from the web, complete with the full commit history and all changes.
git statusShows:
Stage files for the next commit.
git add index.html +git add assets/
Stage everything (use carefully):
git add .
Staging is curatorial: select what belongs together.
git commit -m "Added name to my page"
Good commit message pattern:
git log --oneline --graph
Gives a quick "finding aid" of earlier commits. Press 'q' to exit.
List branches:
git branchCreate a branch:
git branch people/yourname
Switch to branch:
git checkout people/yourname
Shortcut (create + switch):
git checkout -b people/yourname
Branches are parallel dossiers: safe space for changes.
Push your branch to the server:
git push -u origin people/yourname
Pull updates from server:
git pullDuring the exercise you mostly push your branch. Pull is mainly for getting new changes on main (if needed).
Remove a tracked file and stage the removal:
git rm old.html git commit -m "Remove old page"
For this workshop you probably will not need it.
Share your username with us so we can add you as a collaborator
Rules for today:
We will provide:
You will build a (deliberately) simple page:
Workflow loop:
clone -> branch -> edit -> status -> add -> commit -> push -> view -> iterate
cd to a logical location in your computer, then:
git clone https://git.hackersanddesigners.nl/hrk/braids cd braids
If everything went well, check the repo with:
git status -git branch
Choose a slug: lowercase, no spaces. This can be your name or an alias. Example: change people/<your-slug> in the command below to people/alex.
git checkout -b people/<your-slug>
Confirm:
git statusEdit the root index.html (and optionally style.css, assets/).
Make a visible change first:
Then check changes:
git diff +git branch
The first time you checkout from https://git.hackersanddesigners.nl the server will ask you for credentials. These will be remembered, so only once.
Choose a slug: lowercase, no spaces. This can be your name or an alias. Example: change people/<your-slug> in the command below to people/alex.
git checkout -b people/<your-slug>
Confirm:
git statusEdit the root index.html (and optionally style.css, assets/).
Make a visible change first:
Then check changes:
git diff git status
git add index.html git commit -m "Customize profile page for <your-slug>"
If you added assets:
git add assets/ git commit -m "Add assets for <your-slug>"
Small commits win. One change = one deposit.
git push -u origin people/<your-slug>
(Again, change <your-slug>!)
If prompted for credentials, use your Forgejo login method.
Open the gallery:
Find your card:
Iterate:
edit -> status -> add -> commit -> push -> refresh
Wrong branch:
git branch diff --git a/slides.rst b/slides.rst index e84781e..69b6e50 100644 --- a/slides.rst +++ b/slides.rst @@ -246,7 +246,7 @@ Good commit message pattern: git diff --staged - ---- +---- Command: git log (inventory) ============================