refactor: simplify Git basics instructions for students
Co-authored-by: aider (openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
parent
ca2e894f98
commit
13f944eacc
71
z1.txt
71
z1.txt
@ -1,103 +1,102 @@
|
||||
z1
|
||||
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,
|
||||
* dodawać pliki do poczekalni,
|
||||
* zatwierdzać zmiany,
|
||||
* przeglądać różnice.
|
||||
* Check the repository status
|
||||
* Add files to staging area
|
||||
* Commit changes
|
||||
* View differences
|
||||
|
||||
---
|
||||
|
||||
## Słowniczek
|
||||
## Glossary
|
||||
|
||||
* **Śledzony** – plik był w ostatnim commicie
|
||||
* **Nieśledzony** – plik nowy dla Gita
|
||||
* **Poczekalnia** – lista zmian, które wejdą do najbliższego commita
|
||||
* **Commit** – zapisana migawka projektu
|
||||
* **Tracked** – file was in the last commit
|
||||
* **Untracked** – new file for Git
|
||||
* **Staging area** – list of changes that will go into the next commit
|
||||
* **Commit** – saved snapshot of the project
|
||||
|
||||
---
|
||||
|
||||
## Najważniejsze polecenia
|
||||
## Key Commands
|
||||
|
||||
### 1) Sprawdź status
|
||||
### 1) Check status
|
||||
|
||||
```bash
|
||||
git status
|
||||
```
|
||||
|
||||
### 2) Dodaj do poczekalni
|
||||
### 2) Add to staging area
|
||||
|
||||
```bash
|
||||
git add nazwa_pliku
|
||||
git add filename
|
||||
```
|
||||
|
||||
### 3) Zobacz różnice
|
||||
### 3) View differences
|
||||
|
||||
* **Zmiany poza poczekalnią**:
|
||||
* **Changes not in staging area**:
|
||||
|
||||
```bash
|
||||
git diff
|
||||
```
|
||||
|
||||
* **Zmiany w poczekalni**:
|
||||
* **Changes in staging area**:
|
||||
|
||||
```bash
|
||||
git diff --staged
|
||||
```
|
||||
|
||||
### 4) Zatwierdź zmiany
|
||||
### 4) Commit changes
|
||||
|
||||
```bash
|
||||
git commit -m "Opis zmian"
|
||||
git commit -m "Description of changes"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Prosty workflow
|
||||
## Simple workflow
|
||||
|
||||
1. **Sprawdź status**: `git status`
|
||||
2. **Dodaj do poczekalni**: `git add <plik>`
|
||||
3. **Commit**: `git commit -m "Opis"`
|
||||
1. **Check status**: `git status`
|
||||
2. **Add to staging area**: `git add <file>`
|
||||
3. **Commit**: `git commit -m "Description"`
|
||||
|
||||
---
|
||||
|
||||
## Ćwiczenie (10 min)
|
||||
## Exercise (10 min)
|
||||
|
||||
1. **Utwórz repozytorium**
|
||||
1. **Create a repository**
|
||||
|
||||
```bash
|
||||
git init git-lesson
|
||||
cd git-lesson
|
||||
```
|
||||
|
||||
2. **Stwórz i zakomituj plik**
|
||||
2. **Create and commit a file**
|
||||
|
||||
```bash
|
||||
echo "Witaj Git!" > README.md
|
||||
echo "Hello Git!" > README.md
|
||||
git add README.md
|
||||
git commit -m "Dodaj README"
|
||||
git commit -m "Add README"
|
||||
```
|
||||
|
||||
3. **Modyfikuj plik**
|
||||
3. **Modify the file**
|
||||
|
||||
```bash
|
||||
echo "Druga linia" >> README.md
|
||||
echo "Second line" >> README.md
|
||||
git status
|
||||
git diff
|
||||
git add README.md
|
||||
git commit -m "Dodaj drugą linię"
|
||||
git commit -m "Add second line"
|
||||
```
|
||||
|
||||
4. **Sprawdź historię**
|
||||
4. **Check history**
|
||||
|
||||
```bash
|
||||
git log --oneline
|
||||
```
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user