> For the complete documentation index, see [llms.txt](https://til.devjugal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.devjugal.com/git/view-git-commit-changes.md).

# View Git Commit Changes

In order to see changes in a commit, we can make use of either `git diff` or `git show` commands. Below are examples to illustrate their usage -

## Check Changes with `git show`

The `git show` command show the changes introduced in a specific commit. To use it, specify the commit hash:

```bash
git show <commit-hash>
```

## Check Changes with `git diff`

The `git diff` command allows us to compare changes between commits or with the working directory.

### Compare the last commit:

```bash
git diff HEAD~1 HEAD
```

### Compare two specific commits:

```bash
git diff <commit-hash-1> <commit-hash-2>
```

### Show changes between the working directory & the last commit:

```bash
git diff
```

***Source:*** [***StackOverFlow***](https://stackoverflow.com/a/17563740)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/git/view-git-commit-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
