skills/change-commit-history
A skills course on changing the commit history with Git
Featured achievements
The project's latest awards
#1 Repository of the month
#2 Repository of the month
#2 Repository of the month
Remove commit history
Accidental commits can be tricky to remove with Git. In this GitHub Skills course, you'll use BFG Repo-Cleaner to change the history of a Git repository. You can apply what you learn in this course to fully remove sensitive material from your own repository.
Welcome
A trustworthy commit history is the backbone of version control with Git. As a result, altering commit history is difficult by design. Sometimes, the history needs to be altered to remove credentials or other sensitive data that is mistakenly checked in. In this course, we'll learn how to remove content from repository's complete history and apply best practices for preventing accidental commits in the future.
- Who is this for: Intermediate users of Git, organizations
- What you'll learn: How to remove a file from Git's entire history
- What you'll build: You'll manipulate the history of a Git repository
- Prerequisites: We recommend you clone this repository to your machine and use the command line to follow along. You'll also need to install BFG Repo-Cleaner, but the steps will be covered in the course.
- How long: This course takes less than 1 hour to complete.
In this course, you will:
- Remove content from the root directory of a repository
- Use BFG Repo-Cleaner to remove content from repository history
- Avoid future accidental commits by adding a pattern to
.gitignore
How to start this course
- Right-click Start course and open the link in a new tab.
- In the new tab, most of the prompts will automatically fill in for you.
- For owner, choose your personal account or an organization to host the repository.
- We recommend creating a public repository, as private repositories will use Actions minutes.
- Scroll down and click the Create repository button at the bottom of the form.
- After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
Similar Projects
Discover other similar projects and AI models.
Learn how to use MCP Servers with GitHub Copilot
Build and publish Docker images using GitHub Actions.
Let Copilot coding agent tackle your issues directly on GitHub. No coding environment needed.
Create two deployment workflows using GitHub Actions and Microsoft Azure.
Use GitHub Copilot CLI to manage issues and build a Node.js calculator application.
Learn how Copilot Spaces can scale institutional knowledge and streamline organizational processes.
Customize GitHub Copilot's behavior with custom instructions, prompts, and chat modes for your specific development workflows.
Exercise: Idea to Merge with the Copilot App