Topic 1
Pull & Push
Keep the daily remote workflow small: pull before work if needed, commit coherent changes, then push when the work unit is ready.
Key terms
- Stage
- The process of preparing changes to be included in a commit, before actually committing them.
- Commit
- The operation of saving changes to the local Git repository.
- Push
- The action of transferring commits from the local Git repository to a remote repository.
- Pull
- The action of fetching commits from a remote repository and merging them into the local branch.
Check the current state
Before large edits, look at the repository state.
git status
git pull
If nobody else has changed the repository, the pull does nothing — that is expected.
Use a daily sync loop
The loop is:
- pull when the remote may have changed
- work locally
- stage and commit one coherent unit
- push the new commit
Keep commits coherent
A good commit collects one understandable change. It does not need to be huge. It only needs to make sense when you read the history later.
Write a short message that names the unit of work before you publish anything to the remote.
After the commit is ready, push it so the remote history stays aligned with your local work.
Before proceeding
If you can explain when to pull, when to commit, and when to push without improvising, your daily sync loop is ready.