|
1 | | -<p align='center'> |
2 | | - <img src='Assets/banners/banner-bhai-branko.png' /> |
| 1 | +<p align="center"> |
| 2 | + <img src="assets/banners/banner-bhai-branko.png" alt="Code with Branko — Git Tutorial" /> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -## Table of contents |
6 | | - |
7 | | -### Introduction |
8 | | -- [Overview](01-Introduction/01-git-features.md) |
9 | | -- [Installation on Windows](01-Introduction/02-windows-installation.md) |
10 | | -- [Installation on Linux](01-Introduction/03-linux-installation.md) |
11 | | -- [Hosting Services](01-Introduction/04-hosting-services.md) |
12 | | -- [Dataflow Diagram](01-Introduction/05-dataflow-overview.md) |
13 | | -- [Operations Overview](01-Introduction/06-operations-overview.md) |
14 | | - |
15 | | -### Concepts |
16 | | -- [Repository](02-Concepts/01-repository.md) |
17 | | -- [Configuration](02-Concepts/02-configuration.md) |
18 | | -- [Objects](02-Concepts/03-objects.md) |
19 | | -- [Tagging](02-Concepts/04-tagging.md) |
20 | | -- [Index](02-Concepts/05-index.md) |
21 | | -- [References](02-Concepts/06-references.md) |
22 | | -- [Navigation](02-Concepts/07-navigation.md) |
23 | | -- [Branching](02-Concepts/08-branching.md) |
24 | | -- [Merging](02-Concepts/09-merging.md) |
25 | | -- [Stashing](02-Concepts/10-stashing.md) |
26 | | -- [Selectors](02-Concepts/11-selectors.md) |
27 | | -- [Pathspec](02-Concepts/12-pathspec.md) |
28 | | -- [Refspec](02-Concepts/13-refspec.md) |
29 | | -- [Subproject](02-Concepts/14-subproject.md) |
30 | | - |
31 | | -### Operations |
32 | | -- [Help](03-Operations/01-Help/help.md) |
33 | | -- [Create](03-Operations/02-Create/create.md) |
34 | | -- [Configure](03-Operations/03-Configure/configure.md) |
35 | | -- [Track](03-Operations/04-Track/track.md) |
36 | | -- [Branch](03-Operations/05-Branch/branch.md) |
37 | | -- [Sync](03-Operations/06-Sync/sync.md) |
38 | | -- [Revert](03-Operations/07-Revert/revert.md) |
39 | | -- [Inspect](03-Operations/08-Inspect/inspect.md) |
40 | | -- [Reuse](03-Operations/09-Reuse/reuse.md) |
41 | | - |
42 | | -### Appendix |
43 | | -- [Dictionary](04-Appendix/dictionary.md) |
44 | | -- [References](04-Appendix/references.md) |
45 | | -- [Clients](04-Appendix/clients.md) |
46 | | -- [Remarks](04-Appendix/remarks.md) |
47 | | - |
48 | | -### Selected references |
49 | | -- [Git Internals](https://github.com/pluralsight/git-internals-pdf/releases) |
50 | | -- [Flight rules for git](https://github.com/k88hudson/git-flight-rules) |
51 | | -- [Think Like (a) Git](http://think-like-a-git.net/) |
52 | | -- [The Thing About Git](https://tomayko.com/blog/2008/the-thing-about-git) |
53 | | -- [Git Community Book](http://shafiul.github.io/gitbook/index.html) |
54 | | -- [Git Magic](http://www-cs-students.stanford.edu/~blynn/gitmagic/index.html) |
55 | | -- [Git Immersion](https://gitimmersion.com/index.html) |
56 | | -- [Git How To](https://githowto.com/) |
57 | | - |
58 | | - |
59 | | -## Contribution |
60 | | -- [Guidelines](CONTRIBUTING.md) |
61 | | -- [License](LICENSE.md) |
62 | | - |
63 | | -## Credits |
64 | | - - [Branimir Georgiev](https://github.com/braboj) |
65 | | - - [Marwan Rashed](https://github.com/marwan-rashed) |
| 5 | +# Git Tutorial |
66 | 6 |
|
| 7 | +A hands-on Git tutorial for developers who want to go from first commit |
| 8 | +to confident daily use. It covers everything from installation to |
| 9 | +advanced topics like rebase, bisect, and submodules. The content is |
| 10 | +published as a static site built with Astro and deployed to GitHub Pages. |
67 | 11 |
|
| 12 | +## Quick start |
68 | 13 |
|
| 14 | +Prerequisites: [Node.js](https://nodejs.org/) 22+ |
| 15 | + |
| 16 | +```text |
| 17 | +$ git clone https://github.com/braboj/tutorial-git.git |
| 18 | +$ cd tutorial-git/astro-site |
| 19 | +$ npm install |
| 20 | +$ ln -s ../../../assets src/content/assets # image symlink (Linux/macOS) |
| 21 | +$ npm run dev |
| 22 | +``` |
| 23 | + |
| 24 | +Open [localhost:4321](http://localhost:4321) in your browser. |
| 25 | + |
| 26 | +On Windows, the symlink is created as a directory copy automatically. |
| 27 | + |
| 28 | +## Usage |
| 29 | + |
| 30 | +Read the tutorial on the live site: |
| 31 | +[braboj.github.io/tutorial-git](https://braboj.github.io/tutorial-git/) |
| 32 | + |
| 33 | +Chapters can also be read directly as Markdown files in the `chapters/` |
| 34 | +directory. |
| 35 | + |
| 36 | +| # | Chapter | Topics | |
| 37 | +|---|---------|--------| |
| 38 | +| 1 | [Introduction](chapters/01-introduction.md) | What Git is, installation, how it works, command overview | |
| 39 | +| 2 | [Building Blocks](chapters/02-building-blocks.md) | Repositories, objects, references, HEAD, tags | |
| 40 | +| 3 | [Branching and Merging](chapters/03-branching-and-merging.md) | Branches, merge strategies, rebase, cherry-pick, conflicts, stash | |
| 41 | +| 4 | [Remote Repositories](chapters/04-remote-repositories.md) | Clone, push, pull, fetch, remote tracking, forking workflows | |
| 42 | +| 5 | [Subprojects](chapters/05-subprojects.md) | Submodules and subtrees | |
| 43 | +| 6 | [Expert Topics](chapters/06-expert-topics.md) | Configuration, selectors, refspecs, hooks, bisect | |
| 44 | +| 7 | [Playbook](chapters/07-playbook.md) | Step-by-step recipes for common tasks | |
| 45 | +| 8 | [Appendix](chapters/08-appendix.md) | Merge strategies, SSH setup, Git clients, references | |
| 46 | +| 9 | [Glossary](chapters/09-glossary.md) | Key terms and definitions | |
| 47 | + |
| 48 | +## Project structure |
| 49 | + |
| 50 | +``` |
| 51 | +chapters/ # Canonical tutorial content (SSG-agnostic Markdown) |
| 52 | +assets/ |
| 53 | + images/ # PNG exports used in chapters |
| 54 | + drawio/ # draw.io source files (editable) |
| 55 | + banners/ # Banner images |
| 56 | +astro-site/ # Astro static site |
| 57 | + src/ |
| 58 | + content/docs/ # Chapter copies for the Astro content collection |
| 59 | + components/ # Astro components (Header, ToC, TutorialLinks) |
| 60 | + layouts/ # Page layouts |
| 61 | + pages/ # Route definitions |
| 62 | + styles/ # Global CSS |
| 63 | + data/ # Site configuration (site.json) |
| 64 | +docs/ # Project docs, decisions, dev journal |
| 65 | + solid-ai-templates/ # Submodule — quality conventions |
| 66 | +``` |
| 67 | + |
| 68 | +## Development setup |
| 69 | + |
| 70 | +```text |
| 71 | +$ git clone https://github.com/braboj/tutorial-git.git |
| 72 | +$ cd tutorial-git/astro-site |
| 73 | +$ npm install |
| 74 | +$ npm run dev # dev server with hot reload |
| 75 | +$ npm run build # production build to dist/ |
| 76 | +$ npm run preview # preview production build |
| 77 | +``` |
| 78 | + |
| 79 | +After editing a chapter in `chapters/`, copy it to |
| 80 | +`astro-site/src/content/docs/` to update the site. |
| 81 | + |
| 82 | +## Configuration reference |
| 83 | + |
| 84 | +| Key | Location | Description | |
| 85 | +|-----|----------|-------------| |
| 86 | +| `site` | `astro.config.mjs` | Base URL for the deployed site | |
| 87 | +| `base` | `astro.config.mjs` | Path prefix for GitHub Pages (`/tutorial-git/`) | |
| 88 | +| `trailingSlash` | `astro.config.mjs` | URL style — set to `always` | |
| 89 | +| `title` | `src/data/site.json` | Site title shown in header | |
| 90 | +| `tabs` | `src/data/site.json` | Navigation tab labels and hrefs | |
| 91 | +| `tutorials` | `src/data/site.json` | Links to other tutorials in the sidebar | |
| 92 | + |
| 93 | +## Links |
| 94 | + |
| 95 | +- [Live site](https://braboj.github.io/tutorial-git/) |
| 96 | +- [Contribution guide](docs/ONBOARDING.md) |
| 97 | +- [Dev journal](docs/dev-journal.md) |
| 98 | +- [Playbook](docs/PLAYBOOK.md) |
| 99 | + |
| 100 | +## License |
| 101 | + |
| 102 | +[MIT](LICENSE.md) |
0 commit comments