Originally published on Dev.to.
When we're getting started with Git, it can be difficult to understand where our files live, how they change state, and when exactly they leave our local machine to reach the external repository.
I have an analogy for that:
In practice:
- Work on your postcard (implement your changes).
- Put it on the "staged" pocket when you're ready to commit (git add).
- Stamp the postcard (git commit).
- When you're ready, put the postcard in the mailbox (git push).