Loading

Quipoin Menu

Learn • Practice • Grow

git / Checking Status and History
tutorial

Checking Status and History

As you work, you’ll often need to know: what has changed? Which files are staged? What commits have I made? Git provides two essential commands for this: git status and git log.

git status – The Current State

git status shows you exactly what’s going on in your repository. It tells you:
  • Which branch you are on
  • Which files are staged (changes to be committed)
  • Which files are modified but not yet staged
  • Which files are untracked
Try modifying hello.txt and then run git status again:
echo "New line" >> hello.txt
git status
You’ll see Changes not staged for commit: modified: hello.txt.

Short Status

For a compact view, use:
git status -s
It shows symbols like M (modified), A (added), ?? (untracked).

git log – The History

git log displays the commit history in reverse chronological order. Each entry shows:
  • Commit hash (a unique ID)
  • Author and email
  • Date
  • Commit message
Try it:
git log

Making git log More Useful

You can customize the output:
  • git log --oneline – shows each commit on one line (hash + message).
  • git log --graph --oneline --decorate – shows a graphical representation of branches.
  • git log -p – shows the actual changes (diff) for each commit.
  • git log --author="Name" – filters commits by author.

Example Workflow with Status and Log

Let’s stage and commit the change we made, then see the updated log:
git add hello.txt
git commit -m "Add a second line"
git log --oneline
You’ll now see two commits.


Two Minute Drill
  • git status shows the current state: staged, unstaged, untracked files.
  • git status -s gives a compact view.
  • git log displays commit history.
  • Use git log --oneline for a quick overview.
  • Add --graph to visualize branches.

Need more clarification?

Drop us an email at career@quipoinfotech.com