1 Introduction
In the process of using git, you often need to watch the file status, submission status, and operation status. This article will introduce the main operating commands for viewing log information.
2. Use
git status
: Display the file status under the current branch
git add .
before
git add .
adding after adding
git diff
: Display the content of this change.
Red represents the deleted content, and the green represents the added content
git log
: displays all the information in the log, including submission information, time, and author.
Head is the location of the current branch, and the prefix with origin is the remote Branch, which represents the submission position where the branch stays
git log --all
: display all the submitted content under this project
git log --oneline
: display the main information of the changes in the submission
git log --graph
: Display the changes in the submission in the form of line segments
git log --reverse
: Reverse display all logs
git log --author=Linus
: Display operation logs whose author is Linux
git log -n
: Display n logs
git history
: Command line operation logs