Pushing gets your committed local work onto the shared [[Remote repository (git)|remote repository]] - backed up and visible to collaborators. Until you push, a change lives only on your machine, travelling through git's components in order: 1. [[Working directory (git)|Working directory]] 2. [[Staging Area (git)|Staging area]] 3. [[Local repository (git)|Local repository]] 4. [[Remote repository (git)|Remote repository]]. ## 1. See what changed Review the state of your working directory and staging area first, so the commit holds exactly what you intend - nothing forgotten, nothing stray. ![[git status#^cmd]] ## 2. Stage the changes Move the changes you want into the [[Staging Area (git)|staging area]] - this is where you choose what the next commit will contain. Stage related changes together; leave unrelated ones for a separate commit. ![[git add#^cmd]] ## 3. Commit to your local repository Record the staged changes as one [[Atomic Commits|atomic commit]] with a [[Descriptive Commit Messages|descriptive message]] of what changed and why. ![[git commit#^cmd]] ![[Atomic Commits#^principle]] ## 4. Push to the remote Send your local commits to the [[Remote repository (git)|remote repository]], where collaborators can pull them. A brand-new branch needs its upstream set the first time. ![[git push#^cmd]]