🐙
Git Developer Guide
About
  • Overview
  • Scope of this book
  • Table of Content
  • 🐢Introduction to Version Control
    • What is Version Control?
    • Overview of git and it's benefits
    • Setting up Git on Different Platforms
  • 🍼Git Fundamentals
    • Initialising a new Git repository
    • Understanding the Git Workflow
    • Committing Changes and Writing Good Commit Messages
    • Viewing and Navigating Commit History
    • Git Basics - Practice Scenarios
      • Initialising a Git Repository
      • Committing Changes
      • Exploring Commit History
      • Amending and Undoing Commits
  • 🦕Working With Git
    • What is Git Branch?
    • Creating and Switching Between Branches
    • Merging Branches and Resolving Conflicts
    • Best Practices for Branch Management
    • Git Workflows
    • Git Log
    • Git Stash
    • Working with Git - Practice Scenarios
      • Creating and Switching Between Branches
      • Merging Branches and Resolving Conflicts
      • Branching Strategies in a Team Project
      • Rolling Back to a Previous Version
      • Experimenting with Feature Branches
      • Working with Stash
  • 🤝Working with Remote Repositories
    • Cloning a Repository from Remote
    • Pushing and Pulling Changes to and from Remote Repositories
    • Collaborative Workflows - Forking, Branching, and Pull Requests
    • Resolving Conflicts in a Collaborative Environment
    • Collaborating with Git - Practice Scenarios
      • Cloning a Remote Repository
      • Pushing and Pulling Changes
      • Collaborative Workflow with Forking and Pull Requests
      • Resolving Conflicts in a Pull Request
  • 🏆Advanced Git Features
    • Aliases and Custom Configurations
    • Working with Tags and Releases
    • Rewriting Commit History with Interactive Rebase
    • Utilising Git Hooks for Automation
    • Advanced Git Features - Practice Scenarios
      • Creating Custom Git Aliases
      • Working with Tags and Releases
      • Rewriting Commit History with Interactive Rebase
      • Using Git Hooks for Automated Testing
  • 😎Git in Real-World
    • Managing a Project with Multiple Contributors
    • Integrating Git with Continuous Integration, Continuous Deployment (CI, CD)
    • Versioning Assets with Git LFS (Large File Storage)
    • Deploying a Web Application using Git
    • Git In Real World - Practice Scenarios
      • Managing a Project with Multiple Contributors
      • Integrating Git with CICD Pipelines
      • Versioning Assets with Git LFS
      • Deploying a Web Application using Git
  • Git Troubleshooting
    • Common Mistakes and Pitfalls When Using Git
    • Undoing Changes with Git - Reverting and Resetting
    • Recovering Lost Commits or Branches
    • Dealing with Repository Corruption or Other Issues
  • Git Best Practices and Tips
    • Creating efficient git workflows: writing clean code for faster reviews
    • The importance of clean code in collaborative development
    • Significance of consistent naming conventions & coding Standards
    • Good code documentation for better git workflows
    • Writing meaningful git commit messages
    • Atomic commits in git & it's benefits for software teams
    • Structuring code & managing dependencies for better git workflows
    • Git branching strategies for software teams
  • Conclusion & Next Steps
    • Recap of Key Concepts and Commands
    • Further Resources for Expanding Git Knowledge
    • Encouragement and Tips for Continued Learning and Practice
  • License Considerations
Powered by GitBook
On this page

Was this helpful?

  1. Git Fundamentals
  2. Git Basics - Practice Scenarios

Exploring Commit History

The commit history provides a valuable record of changes made to a repository, allowing developers to track progress, understand the evolution of the codebase, and collaborate effectively.

PreviousCommitting ChangesNextAmending and Undoing Commits

Last updated 1 year ago

Was this helpful?

Scenario

Let's imagine that you are a developer working on a team project. You've joined the project recently and want to familiarize yourself with the commit history to gain insights into the development process. Understanding the commit history can help you comprehend the project's evolution, identify relevant changes, and facilitate smoother collaboration with your teammates.

Viewing/Exploring Commits

To begin exploring the commit history, Git provides a command for doing just that. Open up a terminal or command prompt and navigate to the repository directory.

git log

Running this command displays a list of commits in reverse chronological order, with the most recent commit appearing at the top. Each commit includes information such as the commit hash, author, date, and commit message.

Customizing the Log Output

The git log command offers various options to customize the output according to your preferences. Let's explore some commonly used options:

  1. --oneline: This option provides a condensed view of the commit history, showing only the first line of the commit message and the commit hash.

git log --oneline
  1. --graph: This option adds a text-based graph representation, illustrating the branch and merge history within the commit log.

git log --graph

These are just a couple of examples of how you can customize the git log output. Git provides many more options to suit different needs, such as filtering commits by author, date, or specific file changes. You can explore these options in the .

The git log command serves as a powerful tool to review the commit history and gain insights into the project's development process. By customizing the log output with options like --oneline and --graph, you can tailor the view to your specific requirements.

Take advantage of Git's flexibility and explore additional options to enhance your understanding of the commit history.

🍼
official Git documentation on git log