الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

الفصل 7الاسم في الدورة: Git tools

Use stash, tags, bisect, blame and worktrees

Git has tools for the moments that do not fit the normal flow: put unfinished work aside, mark versions, find the commit that broke something, see who changed a line and why, or work on two branches at the same time.

  • 6 الدروس
  • 3 الأوامر

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

7.1

Put work aside with stash

git stash saves uncommitted changes and gives you a clean working tree — for example to fix something urgent on another branch.

git stash push -m "half-done NSG rules"
git stash list
stash@{0}: On feature/web: half-done NSG rules
git switch main
git switch feature/web
git stash pop
git stash push -u
git stash drop stash@{0}

-u also stashes untracked files.

الأوامر في هذا الدرس

7.2

Mark versions with tags

A tag is a fixed name for a commit, usually a version. Annotated tags have a message, an author and a date.

git tag -a v1.0.0 -m "First production release"
git tag
git show v1.0.0
git push origin v1.0.0
git tag -d v0.9.0-test
git push origin --delete v0.9.0-test

تذكّر

Modules and pipelines often use tags as versions (?ref=v1.0.0). Never move a tag that others use — make a new one.

الأوامر في هذا الدرس

7.3

Find the bad commit with bisect

git bisect does a binary search through history: you say "good" or "bad" for each commit Git picks, and it finds the first bad one fast.

git bisect start
git bisect bad
git bisect good v1.2.0
git bisect good
git bisect bad
git bisect run ./test.sh
git bisect reset

With git bisect run SCRIPT, Git tests every step itself (exit code 0 = good).

الأوامر في هذا الدرس

7.4

See who changed a line

git blame shows the last commit for every line — to find why something was changed, not who to blame.

git blame -L 20,40 modules/network/main.tf
git log -S "0.0.0.0/0" --oneline
git log -L 20,30:modules/network/main.tf

git log -S TEXT finds the commits that added or removed a text — great for "when did this rule appear?".

الأوامر في هذا الدرس

7.5

Work on two branches at once

A worktree is a second working folder for the same repository — no need to stash or clone again.

git worktree add ../infra-hotfix hotfix/dns
cd ../infra-hotfix
git worktree list
git worktree remove ../infra-hotfix

الأوامر في هذا الدرس

كل الأوامر في هذا الفصل