refactor: simplify Git basics instructions for students

Co-authored-by: aider (openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
baiobelfer 2025-09-02 10:23:36 +02:00
parent ca2e894f98
commit 13f944eacc

71
z1.txt
View File

@ -1,103 +1,102 @@
z1 z1
z2 z2
Pewnie! Poniżej masz uproszczone instrukcje do tematu **2.2 Podstawy Gita rejestrowanie zmian w repozytorium**. Sure! Below are simplified instructions for the topic **2.2 Git Basics Recording Changes in the Repository**.
# 2.2 Rejestrowanie zmian w Git # 2.2 Recording Changes in Git
## Cel ## Goal
Nauczysz się: You will learn to:
* sprawdzać stan repozytorium, * Check the repository status
* dodawać pliki do poczekalni, * Add files to staging area
* zatwierdzać zmiany, * Commit changes
* przeglądać różnice. * View differences
--- ---
## Słowniczek ## Glossary
* **Śledzony** plik był w ostatnim commicie * **Tracked** file was in the last commit
* **Nieśledzony** plik nowy dla Gita * **Untracked** new file for Git
* **Poczekalnia** lista zmian, które wejdą do najbliższego commita * **Staging area** list of changes that will go into the next commit
* **Commit** zapisana migawka projektu * **Commit** saved snapshot of the project
--- ---
## Najważniejsze polecenia ## Key Commands
### 1) Sprawdź status ### 1) Check status
```bash ```bash
git status git status
``` ```
### 2) Dodaj do poczekalni ### 2) Add to staging area
```bash ```bash
git add nazwa_pliku git add filename
``` ```
### 3) Zobacz różnice ### 3) View differences
* **Zmiany poza poczekalnią**: * **Changes not in staging area**:
```bash ```bash
git diff git diff
``` ```
* **Zmiany w poczekalni**: * **Changes in staging area**:
```bash ```bash
git diff --staged git diff --staged
``` ```
### 4) Zatwierdź zmiany ### 4) Commit changes
```bash ```bash
git commit -m "Opis zmian" git commit -m "Description of changes"
``` ```
--- ---
## Prosty workflow ## Simple workflow
1. **Sprawdź status**: `git status` 1. **Check status**: `git status`
2. **Dodaj do poczekalni**: `git add <plik>` 2. **Add to staging area**: `git add <file>`
3. **Commit**: `git commit -m "Opis"` 3. **Commit**: `git commit -m "Description"`
--- ---
## Ćwiczenie (10 min) ## Exercise (10 min)
1. **Utwórz repozytorium** 1. **Create a repository**
```bash ```bash
git init git-lesson git init git-lesson
cd git-lesson cd git-lesson
``` ```
2. **Stwórz i zakomituj plik** 2. **Create and commit a file**
```bash ```bash
echo "Witaj Git!" > README.md echo "Hello Git!" > README.md
git add README.md git add README.md
git commit -m "Dodaj README" git commit -m "Add README"
``` ```
3. **Modyfikuj plik** 3. **Modify the file**
```bash ```bash
echo "Druga linia" >> README.md echo "Second line" >> README.md
git status git status
git diff git diff
git add README.md git add README.md
git commit -m "Dodaj drugą linię" git commit -m "Add second line"
``` ```
4. **Sprawdź historię** 4. **Check history**
```bash ```bash
git log --oneline git log --oneline
``` ```