OkayStudy
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

All steps
Step 6

Remote repositories

Everything so far lived on your machine. Now connect to a repository on the internet and learn to push, fetch, and pull without surprises.

What you'll learn

  • You can connect a and your
  • You can explain the difference between and
  • You understand and the -u option

A remote is the same living somewhere on the internet, usually on , and by convention it's named origin. You connect it with git remote add origin <URL>, send your commits up with git push, and bring other people's down with git pull. Nothing about your changes — the remote is just another copy that everyone agrees to meet at.

A laptop on a desk sends boxes up to a warehouse on a cloud, and other boxes come down from the warehouse to the laptop.
push sends your commits to the shared warehouse; fetch and pull bring other people's commits back.

Knowing the difference between git fetch and git pull separates the confident from the anxious. fetch only downloads the remote's latest state and leaves your alone. pull fetches and immediately into your branch. When you want to see what landed before accepting it, fetch first, read git log origin/main, then merge.

The -u in git push -u origin main pairs your local branch with the remote one. Once paired, plain git push and git pull are enough from then on. And making git pull --rebase your default keeps meaningless "Merge branch ''…" commits out of the — your commits get replayed on top of what came in, so the log stays a straight line.

Understand it easily

The remote repository is a shared warehouse on the internet. push sends your boxes to the warehouse, fetch checks which new boxes arrived without unpacking them, and pull brings them home and unpacks them into your room.

Commands for this step

Don't just read them — type them into a real . Your hands have to remember, not your eyes.

git remote add origin <URL>
Connect this repository to a remote and name it origin.
git push -u origin main
Push and pair the branches. After this, plain git push works.
git fetch origin
Download the remote's latest state without touching your branch.
git pull --rebase
Pull and replay your commits on top, keeping history in a straight line.

Common mistake and how to fix it

git push is rejected with a message such as '' because someone pushed first. Do not reach for --force. Run git pull --rebase to place your commits on top of theirs, fix any , then push again.

You mark this yourself. Nothing is graded here.

Mark this step as understood?

This cannot be undone yet, so mark it only when you really understand.

Marked as understood

You mark this yourself. Nothing is graded here.

Choose a pending booking to cancel. Each cancellation requires confirmation.

Your :

Close