Git file history
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Git file history provides information about the commit history associated with a file:
Each commit shows:
- The date of the commit. GitLab groups together all commits made on the same day.
- The user’s avatar.
- The user’s name. Hover over the name to see the user’s job title, location, local time, and current status message.
- The date of the commit, in time-ago format. To see the precise date and time of the commit, hover over the date.
- If the commit is signed, a Verified badge.
- The commit SHA. GitLab shows the first 8 characters. Select Copy commit SHA ( ) to copy the entire SHA.
- A link to browse ( ) the file as it appeared at the time of this commit.
GitLab retrieves the user name and email information from the Git configuration of the contributor when the user creates a commit.
View a file’s Git history
To see a file’s Git history in the UI:
- On the left sidebar, select Search or go to and find your project.
- Select Code > Repository.
- Go to your desired file in the repository.
- In the upper-right corner, select History.
Related topics
- Git blame for line-by-line information about a file
- Common Git commands
- File management with Git
Troubleshooting
Limit history range of results
When reviewing history for old files, or files with many commits, you can limit the search results by date. Limiting the dates for commits helps fix commit history requests timeouts in very large repositories.
In the GitLab UI, edit the URL. Include these parameters in YYYY-MM-DD
format:
committed_before
committed_after
Separate each key-value pair in the query string with an ampersand (&
), like this:
?ref_type=heads&committed_after=2023-05-15&committed_before=2023-11-22
The full URL to the range of commits looks like this:
For example:
https://gitlab.com/gitlab-org/gitlab/-/commits/master/CONTRIBUTING.md?ref_type=heads&committed_after=2023-05-15&committed_before=2023-11-22
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support