The Archive is Everywhere
Git local, .git/, clone, bare repo
You find the Master Archivist in an unusual room. No shelves, no stacked scrolls. Just an empty table and a candle. He looks at you with an enigmatic smile.
"Young Archivist, you've learned to seal scrolls in the Archive. But tell me... where exactly is the Archive?"
You point toward the great central hall of the Citadel. The Master shakes his head.
"No. The Archive is not a place. The Archive is everywhere. Every copy of the knowledge IS the Archive. There is no central hall. Every Archivist carries the entire history with them. That is Git's secret."
Git needs no server
This is the most widespread misconception among beginners: many think that Git = GitHub. That to use Git, you need an online account, a server, an internet connection.
That's wrong.
Git is a local tool. It works entirely on your machine, without any network connection. Everything Git needs fits in a single folder: .git/.
Exploring the .git/ folder
When you run git init, Git creates a hidden folder .git/ at the root of your project. That's where everything is stored. Here's its structure:
objects/ ← the data (commits, compressed files)
refs/ ← branches and tags
heads/ ← local branches
tags/ ← tags
hooks/ ← automatic scripts
HEAD ← "where am I right now?"
config ← local repo configuration
index ← staging area
To explore this folder yourself:
ls -la .git/ # Linux / macOS / Git Bash Get-ChildItem .git\ -Force # PowerShell All of Git is this .git/ folder. Delete it and your repo vanishes - you keep only the working files, but the entire history is lost. Copy this folder elsewhere, and you have a complete clone.
Local clone - No internet needed
Since Git is entirely local, you can clone a repo without any internet connection. Just point to a folder on your own machine:
# From the parent folder containing mon-archive/
git clone ./mon-archive ./ma-copie
# Verify that the history is identical
cd ma-copie
git log --oneline # From the parent folder containing mon-archive\
git clone .\mon-archive .\ma-copie
cd ma-copie
git log --oneline The command git clone automatically creates a remote named origin that points to the clone source. Here, origin points to ../mon-archive - a simple path on your disk, not an internet URL.
Bare repo - A repo without a working space
A bare repo is a repo that contains only the contents of .git/ - no working files. It's the format used by Git servers.
# Create a bare repo
git init -b main --bare ./archive-centrale.git
# Add as remote and push
cd mon-archive
git remote add origin ../archive-centrale.git
git push origin main # Create a bare repo
git init -b main --bare .\archive-centrale.git
# Add as remote and push
cd mon-archive
git remote add origin ..\archive-centrale.git
git push origin main This is exactly what a Git server does. When you git push to GitHub, you're sending your commits to a bare repo hosted on their servers. Nothing magical about it.
The architecture in action
Here's how the three repos interact:
.git/ + files .git/ + files All three repos contain the same history. Each copy is autonomous.
Demystifying platforms
GitHub, GitLab, Forgejo, Bitbucket... are servers that host bare repos and add a web interface on top.
| Feature | Git | Platform |
|---|---|---|
| Commits, branches, history | ✓ | |
| Push, pull, clone | ✓ | |
| Issues (bug tickets) | ✓ | |
| Pull Requests / Merge Requests | ✓ | |
| CI/CD (automated tests) | ✓ | |
| Built-in wiki | ✓ | |
| Web interface for code | ✓ |
You don't need a GitHub account to use Git. You don't need the internet to make commits. A shared folder, a USB drive, or an SSH server is enough to collaborate.
Practical exercise
Create three copies of the same repo and verify they share the same history.
- git clone
mon-archive/toma-copie/ - Create a bare repo
archive-centrale.git - Add it as a remote in
mon-archive/and push - git clone from the bare repo to
clone-depuis-bare/ - Verify that all 3 have the same history with
git log --oneline - Run the verification script
Prerequisites
You need the mon-archive/ repo from quest 03. If you don't have it:
mkdir mon-archive && cd mon-archive
git init -b main
echo "Welcome to the Archive" > README.md
git add README.md
git commit -m "First parchment"
cd .. The commands
# 1. Clone local
git clone ./mon-archive ./ma-copie
# 2. Bare repo
git init -b main --bare ./archive-centrale.git
# 3. Add the remote and push
cd mon-archive
git remote add origin ../archive-centrale.git
git push origin main
cd ..
# 4. Clone from the bare repo
git clone ./archive-centrale.git ./clone-depuis-bare
# 5. Verify the history
cd mon-archive && git log --oneline && cd ..
cd ma-copie && git log --oneline && cd ..
cd clone-depuis-bare && git log --oneline && cd .. Verification
bash verifier.sh .\verifier.ps1 The Master Archivist looks at you with pride.
"You now understand the true power of the Archive. It depends on no tower, no server, no platform. Every copy is complete. Every Archivist is autonomous. In the next quest, we'll explore the Lines of Time - you'll learn to navigate through the Archive's history."