Chapter 3: Branching, Merge and GitHub PRs
3.9 Remote refresh — fetch, pull, push
You met clone in Chapter 2. For branching work, these three matter daily:
| Command | Meaning |
|---|---|
git push -u origin <branch> |
Upload your branch; set upstream once |
git fetch |
Download new commits; do not merge yet |
git pull |
Fetch + merge into your current branch (often main) |
Habit before a new feature branch: git switch main → git pull → git switch -c feature/... so you start from the newest main.
Practice task
Draw the path: laptop feature branch → git push → PR → merge on GitHub → git pull on laptop main. Label each arrow with the command or UI action.
Thodkyaat sangaycha tar
- Branches = separate drafts; merge joins them into
main. - Daily loop: update
main, create feature branch, commit, push, open PR, review, merge. - Protect
main— no casual direct commits on team repos. - Conflicts: edit out markers,
git add, finish the merge commit. - Tags mark versions lightly; prefer clear version names over vague
latestin production talk.
Samajla ka? Nasel tar feature-branch steps (3.3) aani conflict fix (3.6) punha kara – PR shivay main var commit karaychi chuk sodun dya. Aata pudhe jaauya Linux ops refresh kade.