git clone https://github.com/jonas/tig.git && cd tig && make && sudo make install
tig --version## التثبيت
أمر
وصف
tig
عرض الواجهة الرئيسية التي تظهر سجل الالتزامات في المستودع الحالي
tig status
Show working directory status (like git status)
tig blame <file>
اعرض الملكية السطرية للملف
tig <file>
إظهار سجل التعديلات لملف محدد
tig show <commit>
عرض تفاصيل commit محدد
tig refs
اعرض كل الفروع والعلامات
tig stash
عرض جميع التغييرات المخزنة
tig log
عرض سجل التعديلات
tig diff
إظهار التغييرات غير المرحلة في دليل العمل
tig grep <pattern>
البحث عن نمط في المستودع
tig <branch>
إظهار commits من فرع محدد
tig --all
إظهار commits من جميع الفروع
tig --help
عرض معلومات المساعدة
tig --version
اعرض معلومات إصدار tig
مفتاح
وصف
j / ↓
انزل سطرًا واحدًا للأسفل
k / ↑
انتقل لأعلى سطر واحد
h / ←
مرر لليسار
l / →
مرر لليمين
PgUp / b
صفحة للأعلى
PgDn / Space
صفحة للأسفل
Home
انتقل إلى السطر الأول
End
انتقل إلى السطر الأخير
Enter
فتح/تحديد العنصر (يعتمد على السياق)
Tab
الانتقال إلى العرض التالي
q
إغلاق العرض الحالي
Q
أغلق جميع العروض وأغلق البرنامج
R
إعادة تحميل/تحديث العرض الحالي
O
قم بتكبير العرض الحالي
h
عرض المساعدة وارتباطات المفاتيح
مفتاح
وصف
/
ابحث للأمام
?
ابحث للخلف
n
ابحث عن المباراة التالية
N
العثور على المباراة السابقة
[
انتقل إلى كتلة الاختلاف السابقة
]
انتقل إلى كتلة الاختلاف التالية
{
انتقل إلى الملف السابق في diff
}
انتقل إلى الملف التالي في الفرق
أمر
وصف
tig --author="Name"
تصفية المراجعات حسب مؤلف محدد
tig --since="2 weeks ago"
عرض commits من تاريخ نسبي
tig --after="2024-01-01" --before="2024-12-31"
إظهار الالتزامات ضمن نطاق تاريخ
tig --grep="pattern"
اعرض المراجعات التي تحتوي على نمط في الرسالة
tig --merges
إظهار فقط عمليات الدمج
tig --no-merges
استبعاد عمليات الدمج
tig main..feature
اعرض الـ commits في branch الميزة والتي لم تكن موجودة في branch الرئيسي
tig main...feature
اعرض التغييتات (commits) المختلفة بين الفروع
tig --follow -- <file>
تتبع تاريخ الملف من خلال إعادة التسمية
tig -S"function_name"
بحث المعول: التغييرات في التكرارات
tig -G"regex"
عرض commits حيث يتطابق diff مع regex
tig -n 100
قيّد إلى آخر 100 عملية إرسال
tig -- '*.py'
إظهار التعديلات التي تؤثر على ملفات Python فقط
tig reflog
تصفح إدخالات Git reflog
tig show <commit>:<path>
عرض محتوى الملف في التعديل (commit) المحدد
tig blame +<line> <file>
افتح عرض المسؤولية عند رقم سطر محدد
مفتاح
عرض
وصف
u
الحالة
مرحلة/إلغاء مرحلة ملف أو جزء
1
الحالة
مرحلة/إلغاء مرحلة سطر واحد
!
الحالة
استعادة الملف أو القطعة
C
الحالة
التزم بالتغييرات المرحلية
C
الرئيسي/السجل
اختيار التعديل (cherry-pick)
e
الرئيسي/السجل
تحرير رسالة الالتزام (إذا كان HEAD)
!
الرئيسي/السجل
التراجع عن التعديل
@
الرئيسي/السجل
الانتقال للتأكيد (checkout)
C
المراجع
إنشاء فرع جديد
d
المراجع
احذف الفرع
m
المراجع
دمج الفرع
!
أي
تنفيذ الأمر الخارجي
:
أي
Execute git command (e.g., :!git reset)
$XDG_CONFIG_HOME/tig/config## العمليات التفاعلية (داخل Tig)
~/.config/tig/config## الإعدادات
يقرأ Tig الإعدادات من هذه المواقع (حسب الأولوية):
~/.tigrc``$GIT_DIR/tigrc(عادة /etc/tigrc)```bash
Create user config directory and file
mkdir -p ~/.config/tig
touch ~/.config/tig/config
Or use traditional location
touch ~/.tigrc
# Customize interface colorscolor cursor white blue boldcolor title-focus white blue boldcolor title-blur white black bold# Diff colorscolor diff-header yellow defaultcolor diff-chunk magenta defaultcolor diff-add green defaultcolor diff-del red default# Status colorscolor stat-staged green defaultcolor stat-unstaged red defaultcolor stat-untracked yellow default``````bash# Configure main view columnsset main-view = id:yes date:default author:full commit-title:yes,graph:yes,refs:yes# Set commit ID widthset id-width = 10# Enable line numbers in blame viewset blame-view = date:default author:full id:yes,color line-number:yes,interval=1 text# Line number display intervalset line-number-interval = 5# Horizontal scrolling percentageset horizontal-scroll = 33%# Tab size for displayset tab-size = 4# Truncation indicatorset truncation-delimiter = ~``````bash# Number of context lines in diffsset diff-context = 3# Ignore whitespace (options: no, all, some, at-eol)set ignore-space = some# Use patience diff algorithmset diff-options = --patience# Show untracked files in status viewset status-show-untracked-files = yes```(خاص بالمستودع)```bash# Bind 'C' in main view to cherry-pickbind main C !git cherry-pick %(commit)# Bind 'P' in status view to pushbind status P !git push# Bind 'F' to fetch in main viewbind main F !git fetch# Bind 'S' to create stashbind status S !git stash save "%(prompt Enter stash message: )"# Bind 'A' to amend commitbind status A !git commit --amend# Open commit in browser (GitHub)bind main B !@hub browse -- commit/%(commit)``````bash# Wrap long linesset wrap-lines = yes# Show changes in status viewset status-show-untracked-dirs = yes# Refresh interval (seconds)set refresh-mode = autoset refresh-interval = 1# Mouse supportset mouse = yes# Editor for commit messagesset editor-line-number = yes```(على مستوى النظام)### إنشاء ملف الإعدادات```bash# Open repositorytig# Navigate to commit (use j/k)# Press Enter to see full diff# Press Tab to switch between views# Press q to go back# Review specific branchtig feature-branch# Compare branchestig main..feature-branch```### حالة الاستخدام 2: العثور على متى تم إدخال الخلل```bash# Search for specific code changetig -S"problematic_function"# Or search commit messagestig --grep="bug\|fix" -i# View blame for specific filetig blame src/buggy-file.js# Navigate to suspicious line# Press Enter to see the commit# Press Tab to see full commit details```### حالة الاستخدام 3: التصنيف والالتزام التفاعلي```bash# Open status viewtig status# Navigate to files (j/k)# Press 'u' to stage/unstage files# Press '1' to stage individual lines# Press 'C' to commit when ready# Write commit message and save```### حالة الاستخدام 4: استكشاف تاريخ المشروع```bash# View all commits with graphtig --all# Filter by author and datetig --author="John Doe" --since="1 month ago"# View commits affecting specific filestig -- src/core/*.py# Follow file through renamestig --follow -- src/renamed-file.js```### حالة الاستخدام 5: إدارة الفروع```bash# View all branches and tagstig refs# Navigate to branch# Press 'C' to create new branch# Press 'd' to delete branch# Press 'm' to merge branch# Press Enter to view branch commits```## أفضل الممارسات- **تعلم اختصارات لوحة المفاتيح**: تم تصميم Tig للتنقل باستخدام لوحة المفاتيح. احفظ `j/k`للتحرك، `Enter`للتعمق، و `q`للعودة للتصفح بكفاءة.- **استخدم الأوامر الخاصة بالعرض**: لكل عرض عمليات مختلفة. اضغط `h`في أي عرض لرؤية الارتباطات المفتاحية المتاحة في ذلك السياق.- **خصص إعداداتك**: أنشئ ملف `~/.config/tig/config`لتخصيص الألوان والارتباطات وإعدادات العرض بما يتوافق مع سير عملك وتفضيلاتك.- **الجمع بين أوامر Git**: استخدم tig للتصور وأوامر Git للعمليات. Tig يكمل Git وليس بديلاً عنه.- **استخدم المرشحات للمستودعات الكبيرة**: في المستودعات التي تحتوي على آلاف الالتزامات، استخدم `--author`، `--since`، `--grep`، أو مرشحات الملفات لتضييق النتائج.- **استفد من عرض الحالة**: استخدم `tig status`كبديل تفاعلي لـ `git add -p`للتحكم الدقيق في التصنيف.- **استكشف باستخدام Tab**: استخدم `Tab`للتبديل بين العروض ذات الصلة ورؤية منظورات مختلفة للبيانات نفسها (الالتزام → الاختلاف → الشجرة).- **إعداد تكوينات خاصة بالمستودع**: أنشئ `.git/tigrc`في المستودعات التي تحتاج إعدادات خاصة دون التأثير على التكوين العام.## استكشاف المشكلات| مشكلة | حل ||-------|----------|| Tig not found after installation | Ensure tig is in your PATH: `which tig`. Restart terminal or run `source ~/.bashrc` || Colors not displaying correctly | Check terminal supports 256 colors. Set `TERM=xterm-256color` or configure colors in `~/.tigrc` || Slow performance in large repos | Use filters to limit commits: `tig -n 1000` or `tig --since="1 month ago"`. Consider `set refresh-mode = manual` || UTF-8 characters display incorrectly | Set locale: `export LC_ALL=en_US.UTF-8` and `export LANG=en_US.UTF-8` in shell config || Mouse not working | Enable in config: `set mouse = yes`. Ensure terminal supports mouse events || Can't edit commits or stage files | Ensure you have write permissions and are in a valid Git repository. Check `git status` works || Custom key bindings not working | Verify syntax in config file. Check for conflicts with default bindings. Reload with `R` || Tig crashes on startup | Check Git repository is valid: `git status`. Update tig to latest version. Remove custom config temporarily || Diff view shows binary files | Add to `.gitattributes`: `*.bin -diff`. Or set `set diff-options = --no-binary` || Line numbers not showing | Enable in config: `set line-number-interval = 1` and ensure view supports line numbers |## بطاقة المرجع السريع```LAUNCHING TIG NAVIGATION OPERATIONStig j/k ↓/↑ Move u Stage/unstagetig status h/l ←/→ Scroll C Commit/cherry-picktig blame <file> PgUp/PgDn Page ! Revert/executetig <branch> Enter Select e Edittig --all Tab Next view @ Checkout q/Q Quit R RefreshSEARCH VIEWS FILTERS/ Search forward tig Main --author="Name"? Search backward tig status Status --since="date"n Next match tig refs Branches --grep="pattern"N Previous match tig blame Blame --no-merges[ Prev chunk tig stash Stash -- '*.ext'] Next chunk tig diff Diff```
This site uses cookies for analytics and to improve your experience.
See our Privacy Policy for details.