git status to see changesgit status -s View changes in simple modegit status --ignored show ignored filesgit log View logsgit log --oneline View logs in a single linegit log --stat Show detailed commit historygit reflog Show the last few commits for the current branchgit log <-number> [--pretty] [--oneline] Show past commitsgit log --follow [file] Show file version historygit blame [file] Show who modified the specified file and whengit show [--name-only] <commit-id> Show changes to commitsgit show [commit-id]:[file] Show the contents of a file when a commit was madegit log --grep <keyword> filter & searchgit log --author <author-name> Query for a specific authorgit log --after='<date>' --until='<date>' Find by date
git log --oneline --after="2019-02-20" --until='2020-02-20'
git grep <keyword> [branch-name|tag-name] search
git grep "Hello"
git grep "Hello" v2.5
git diff shows the difference between the staging area and the workspacegit log -p [file] Show every diff associated with a given filegit diff --cached [file] Show the difference between the staging area and the previous commitgit diff [first-branch] [second-branch] Show the difference between two commitsgit diff HEAD Show the difference between the workspace and the latest commit of the current branchgit shortlog -sn Show all users who have committed, sorted by number of commitsgit diff --shortstat "@{0 day ago}" Shows how many lines of code you’ve written todaygit log --graph --decorate --oneline Plot branch graphs