![]() Before moving forward, we need to create some more commits. This is a convenient default, but it's commonly required to filter the commits displayed in the log output. There are exceptions to this ordering rule, which will be seen in future examples. The git log sort order defaults to reverse chronological order, which essentially shows commits in descending order based on commit datetime. As previously mentioned, git log defaults to showing us the commit hash, author and email, date, and the commit message. Let’s take a look at the output from running a simple git log command: $ git logĬommit 85c035458122ca9f90a56fc2fa167bb61d22580b (HEAD -> master)Ĭommit cd918fd09e0014eefbcf9516a6ad99c431315838Īs can be seen from the output, our log has returned both of our commits. ![]() So far, we’ve initialized a Git repo and made our initial commit, made some changes to one of the files, and committed the changes. $ git commit -m "Added sample text to file1.ext" Now we’ll add these changes to the Git staging area, and commit them: $ git add file1.ext Next, let’s add a few lines of comments to the previously empty file file1.ext: file1.ext git log Example Default Outputīefore diving in, let’s assume we have a new Git repository at project root folder git-log-example/ and look at the git log default output: git-log-example/ Git log also comes with a rich set of logging options for filtering, ordering, and formatting output. Git's active branch is the one that is currently checked out in the working directory. The default output includes the commit ID, commit author, developer email, commit date and commit message string for each commit on the active branch. The git log command shows a default output for quickly reviewing the commit history. Each set of changes made by a developer is recorded as a commit in Git. The git log command is used to view the history of committed changes within a Git repository.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |