Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions sites/he/glossary/add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Add (הוספה)

**הגדרה קצרה:** פקודה ב-Git שמעבירה קבצים או שינויים מאזור העבודה (working directory) לאזור ההכנה (staging area), כדי להכין אותם ל-commit.

## הסבר מורחב

`Add` (הוספה) היא הפקודה שמעבירה שינויים מאזור העבודה לאזור ההכנה. זה השלב הראשון בתהליך ה-commit, שבו אתה בוחר איזה שינויים לכלול ב-commit הבא.

**דוגמאות לשימוש נפוץ:**
* הוספת קבצים חדשים למעקב
* הכנת שינויים ל-commit
* הוספת קבצים לפי סוג או מיקום
* הוספת כל השינויים בבת אחת

## דוגמת קוד

### פקודות Git בטרמינל
```bash
# הוספת קובץ ספציפי
git add file.txt

# הוספת כל השינויים
git add .

# הוספת קבצים לפי סיומת
git add *.js
git add *.py

# הוספת קבצים בתיקיה
git add src/

# הוספת קבצים עם pattern
git add "*.{js,css,html}"

# הוספת קבצים אינטראקטיבית
git add -i

# הוספת קבצים עם patch
git add -p

# הוספת קבצים עם אימות
git add --dry-run file.txt
```

### פייתון (שימוש בספריית GitPython)
```python
from git import Repo

repo = Repo('my_repo')

# הוספת קובץ
def add_file(repo, file_path):
repo.index.add([file_path])
print(f"נוסף {file_path}")

# הוספת כל השינויים
def add_all(repo):
repo.index.add('*')
print("נוספו כל השינויים")

# הוספת קבצים לפי pattern
def add_pattern(repo, pattern):
repo.index.add(pattern)
print(f"נוספו קבצים לפי {pattern}")

# בדיקת מה נוסף
def check_added(repo):
staged = repo.index.diff('HEAD')
print(f"קבצים שהוכנו: {len(staged)}")
for diff in staged:
print(f" {diff.a_path}")

add_file(repo, "new_file.txt")
check_added(repo)
```

## מונחים קשורים

* [Staging Area (אזור ההכנה)](./staging.md)
* [Commit (התחייבות)](./commit.md)
* [Status (מצב)](./status.md)

## מקורות מידע נוספים

* [תיעוד Git על git add](https://git-scm.com/docs/git-add)
59 changes: 59 additions & 0 deletions sites/he/glossary/blame.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Blame (הצגת מי שינה כל שורה)

**הגדרה קצרה:** פקודה ב-Git המציגה מי שינה כל שורה בקובץ, כולל זיהוי ההתחייבות, המחבר והתאריך.

## הסבר מורחב

`Blame` (הצגת מי שינה כל שורה) מאפשר לך לראות מי אחראי לכל שורה בקובץ. זה שימושי למציאת מקור באגים, הבנת היסטוריית הקוד, וזיהוי מי צריך לבדוק שינוי ספציפי.

**דוגמאות לשימוש נפוץ:**
* מציאת מי הכניס באג לקוד
* הבנת מי עבד על פיצ'ר מסוים
* זיהוי מי צריך לבדוק שינוי

## דוגמת קוד

### פקודות Git בטרמינל
```bash
# הצגת blame של קובץ
git blame file.txt

# הצגת blame עם מספר שורות
git blame -L 10,20 file.txt

# הצגת blame עם תאריכים
git blame --date=short file.txt

# הצגת blame עם זיהוי התחייבות
git blame -w file.txt
```

### פייתון (שימוש בספריית GitPython)
```python
from git import Repo

repo = Repo('my_repo')

# הצגת blame של קובץ
def show_blame(repo, file_path):
try:
blame = repo.blame('HEAD', file_path)
for commit, lines in blame:
for line in lines:
print(f"{commit.hexsha[:8]} {commit.author.name}: {line}")
except Exception as e:
print(f"שגיאה: {e}")

# דוגמה
show_blame(repo, "main.py")
```

## מונחים קשורים

* [Log (היסטוריה)](./log.md)
* [Commit (התחייבות)](./commit.md)
* [Diff (הבדלים)](./diff.md)

## מקורות מידע נוספים

* [תיעוד Git על git blame](https://git-scm.com/docs/git-blame)
57 changes: 57 additions & 0 deletions sites/he/glossary/branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Branch (ענף)

**הגדרה קצרה:** ענף הוא קו פיתוח עצמאי במאגר קוד (repository) במערכת ניהול גרסאות כמו **Git**. כל ענף מאפשר לבצע שינויים, פיתוחים או ניסויים מבלי להשפיע על הקוד הראשי (לרוב master/main).

## הסבר מורחב

`Branch` (ענף) הוא כלי מרכזי בעבודה עם Git. כל ענף הוא למעשה הצבעה (pointer) להיסטוריית התחייבויות (commits) נפרדת, שמאפשרת פיתוח במקביל למספר כיוונים. נהוג ליצור ענפים חדשים עבור פיצ'רים, תיקוני באגים, ניסויים או גרסאות שונות של הפרויקט. כאשר העבודה בענף מסתיימת, ניתן למזג (merge) אותו חזרה לענף הראשי או לכל ענף אחר.

היתרונות העיקריים של **Branch** הם:
* **פיתוח במקביל:** מספר מפתחים/ות יכולים לעבוד על פיצ'רים שונים מבלי להפריע זה לזו.
* **ניסוי וטעייה:** ניתן לבדוק רעיונות חדשים מבלי לסכן את הקוד היציב.
* **ניהול גרסאות:** מאפשר לנהל גרסאות שונות של הפרויקט (למשל, גרסת פיתוח מול גרסת ייצור).

**דוגמאות לשימוש נפוץ:**
* יצירת ענף חדש עבור פיצ'ר: `git checkout -b feature/login`
* עבודה על תיקון באג בענף נפרד.
* מיזוג (merge) של ענף הפיצ'ר לענף הראשי לאחר סיום הפיתוח.

## דוגמת קוד

### פקודות Git בטרמינל
```bash
# יצירת ענף חדש ומעבר אליו
git checkout -b feature/login

# מעבר לענף קיים
git checkout main

# מחיקת ענף מקומי
git branch -d feature/login
```

### פייתון (שימוש בספריית GitPython)
```python
from git import Repo
repo = Repo('my_repo')
# יצירת ענף חדש
new_branch = repo.create_head('feature/login')
# מעבר לענף החדש
new_branch.checkout()
# מעבר לענף קיים
repo.heads.main.checkout()
# מחיקת ענף (דרך git)
repo.git.branch('-d', 'feature/login')
```

## מונחים קשורים

* [Repository (מאגר קוד)](./repository.md)
* [Commit (התחייבות)](./commit.md)
* [Merge (מיזוג)](./merge.md)
* [Pull Request (בקשת משיכה)](./pull-request.md)

## מקורות מידע נוספים

* [תיעוד Git על Branches](https://git-scm.com/book/he/v2/%D7%91%D7%A1%D7%99%D7%A1-%D7%94-Git-%D7%A2%D7%A0%D7%A4%D7%99%D7%9D-%D7%91%D7%92%D7%99%D7%98)
* [תיעוד GitHub על Branches](https://docs.github.com/en/get-started/quickstart/github-glossary#branch)
Loading