~/
hackweb.dev
Viewing Status and History
Quiz
⌘K
...
~/
/tutorials
/git/git-status-log/edit
~ Contribute
Suggest a correction or improvement. The author reviews it before it goes live.
Loading...
Comment
0 / 300
Typo
Grammar
Broken link
Clarify
Code
en/tutorials/git/5git-status-log
Write
Preview
Diff
# Viewing Status and History Git provides commands to check the state of your repository and view the history of changes. ## Checking Status See what's changed, staged, or untracked: ```bash git status # On branch main # Changes not staged for commit: # modified: file.txt # # Untracked files: # newfile.txt ``` ## Viewing Commit History See all commits with full details: ```bash git log # commit a1b2c3d (HEAD -> main) # Author: Your Name <you@example.com> # Date: Mon Sep 8 12:00:00 2026 # # Add login page ``` ## Compact Log View Show one commit per line: ```bash git log --oneline # a1b2c3d Add login page # b2c3d4e Initial commit ``` Limit results: ```bash git log --oneline -5 ``` ## Visualizing Branches See branch relationships: ```bash git log --graph ``` ## Best Practices - Check status before committing - Use `git log --oneline` for quick overview - Use `git log --graph` to understand branch structure - Review history regularly to understand project evolution ## Common Mistakes - Forgetting to check status before committing - Not understanding the difference between staged and unstaged changes - Ignoring untracked files that should be committed - Not using branches for experimental work
No changes yet
Reset to original
Submit suggestion
cancel