QuickDevGuide

Home › GitHub

Push, Pull & Fetch — GitHub

These three commands manage data transfer between your local repository and the remote GitHub repository. git push: Uploads your local commits to the remote repository. Only the current branch is pushed. If the remote has newer commits, push will be rejected — you must pull first. git pull: Downloads AND merges remote changes into your current branch. It is equivalent to git fetch + git merge. Always pull before starting new work to avoid conflicts. git fetch: Downloads remote changes but does NOT merge them. It updates your knowledge of the remote branches without changing your working code. Use this when you want to review changes before merging. Common issue: "rejected — non-fast-forward." This means someone else pushed changes to the same branch. Solution: git pull first, resolve any…

Key Takeaways