The daily loop — status, add, commit, log
Ninety percent of your time with GIT is these four commands. You'll also learn what belongs in one commit and how to write a message worth reading.
What you'll learn
- You can run the status → add → commit loop without hesitating
- You can judge what belongs in a single commit
- You can read history and find the commit you want
The daily loop is simple: see what you changed with git status, pick what goes into this commit with git add, nail it down with git commit, then read the history with git log. You'll repeat this dozens of times a day on the job, so the goal of this step is to repeat it until your hands do it without you.
One commit should carry one logical change. If you fix a login bug and also tidy the indentation that was bothering you, you can no longer revert just the bug fix later. git add -p lets you stage parts of a single file, so get into the habit of splitting work at commit time even when you did it all at once.
A commit message is a letter to your future self and your teammates. Keep the first line around 50 characters, say what you did in the imperative, and if needed add a blank line and why. A type prefix — fix: redirect home after login — follows the Conventional Commits convention and makes history machine-readable too. Messages like "fix" or "work" tell nobody anything.
Commands for this step
Don't just read them — type them into a real terminal. Your hands have to remember, not your eyes.
git add <file>- Stage a file you changed.
git add -p- Stage only chosen chunks inside a file — this is how you split commits.
git commit -m "fix: 로그인 리다이렉트 오류 수정"- Nail the staged changes into history. Say what you did and, if it matters, why.
git log --oneline --graph --all- Read history one line per commit with a branch graph — the log form you'll use most.