skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
git-pushing-and-pulling
This page is read only. You can view the source, but not change it.
# Git pushing and pulling **Pushing** sends your commits to a remote; **pulling** fetches and merges from a remote. Push when you've committed changes locally and want to share them. Pull before pushing to avoid conflicts, and pull regularly to stay in sync with teammates. ```bash $ git push <remote> <branch> # push commits to remote $ git push origin main # common: push main to origin $ git pull <remote> <branch> # fetch and merge from remote $ git pull origin main # common: pull main from origin $ git fetch <remote> # fetch without merging ``` `git pull` is shorthand for `git fetch` followed by `git merge`. If the remote has new commits you haven't pulled yet, pushing will fail—you must pull first to avoid overwriting teammates' work. Use `git pull --rebase` if you prefer rebasing over merging.
Page Tools
Show pagesource
Backlinks
Back to top