خانه درس‌ها
درس ۱۲ اصلی ۱۸ دقیقه

clone، push و pull

همگام‌سازی با مخزن راه دور.

کلون

Terminal
git clone https://github.com/USER/REPO.git
cd REPO

اولین push از پروژه محلی

Terminal
git remote add origin https://github.com/USER/REPO.git
git branch -M main
git push -u origin main

pull و fetch

  • git pull: دریافت + ادغام (یا rebase طبق تنظیم)
  • git fetch: فقط دریافت اطلاعات remote بدون ادغام فوری
قبل از push، اگر روی remote کار جدید هست، اول pull/همگام کنید تا از rejected جلوگیری شود.