Skip to content

Everyday Git

Last updated 2026-08-20 · 5 notes · 3 tags

Tags: git github status

Git saves snapshots of your project so you can undo mistakes and publish to GitHub. Run these commands from inside your project folder (cd ~/projects/your-project).

Status — what changed?

git status

Note: Run git status often. It is the safest way to see what Git will include in the next save.

Pull — get latest from GitHub

git pull

Use this before you start work if others (or another computer) may have pushed changes.

Add — stage files to save

git add .

Stages all changes in the current folder tree. To stage one file:

git add path/to/file

Commit — save a snapshot

git commit -m "Short description of the change"

Note: Write the message for a future you: what changed and why, in one short sentence.

Push — upload to GitHub

git push

Fetch — check remote without merging

git fetch

Note: fetch downloads updates but does not change your files yet. pull fetches and merges.

Log — recent history

git log --oneline --graph

Branches — list them

git branch
git branch -a

Note: main (or sometimes master) is usually the primary branch. Create feature branches when you want experiments isolated — see Branches.

Typical daily loop

git status
git add .
git commit -m "Describe the change"
git push

Note: If git push asks you to set an upstream the first time, follow the exact git push --set-upstream ... line Git prints, or use gh after gh auth login.

Common mistakes

  • Commit before large deletions or refactors.
  • Do not commit secret files (.env, API keys). Add them to .gitignore.
  • If Git says “not a repository,” you are in the wrong folder or never ran git init / cloned the project.

This project captures ideas, decisions, and lessons I’ve learned while building with AI. It aims to help non-technical users understand and use these tools effectively. I also use AI at times to improve or refine the content.

Readers should use the commands and instructions here with care. The creator accepts no responsibility for system damage, data loss or other consequences resulting from their use.