Git Commit
Committing changes to repository
Basic Commit
git commit -m 'commit message' # commit with message
git commit -am 'message' # add and commit tracked files
git commit # open editor for message
Amend Commit
git commit --amend -m 'new message' # change last commit message
git commit --amend --no-edit # add changes to last commit
View Commits
git log # show commit history
git log --oneline # compact view
git log --graph # show branch graph
git log -n 5 # last 5 commits
Show Commit
git show # show commit details
git show HEAD # show last commit
Commit History
git log --author='John' # commits by author
git log --since='2 weeks ago' # recent commits
git log --grep='bug' # search commit messages