Top "Git-rewrite-history" questions

Rewriting the history of a Git repository, for example to edit old commits, remove unwanted data (e.g. private data or large files), rearrange file structure, fix commit metadata, etc.

How to modify existing, unpushed commit messages?

I wrote the wrong thing in a commit message. How can I change the message? The commit has not been …

git git-commit git-rewrite-history amend
How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script in the school computer, and committing the changes to Git (in a repo that …

git version-control git-filter-branch git-rewrite-history
How to modify a specified commit?

I usually submit a list of commits for review. If I have the following commits: HEAD Commit3 Commit2 Commit1 ...I …

git git-rewrite-history
How can one change the timestamp of an old commit in Git?

The answers to How to modify existing, unpushed commits? describe a way to amend previous commit messages that haven't yet …

git timestamp commit git-rewrite-history
How do you fix a bad merge, and replay your good commits onto a fixed merge?

I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me …

git git-filter-branch git-rewrite-history git-rm
How to remove/delete a large file from commit history in Git repository?

I accidentally dropped a DVD-rip into a website project, then carelessly git commit -a -m ..., and, zap, the repo was …

git version-control git-rebase git-rewrite-history
How to squash all git commits into one?

How do you squash your entire repository down to the first commit? I can rebase to the first commit, but …

git rebase git-rebase squash git-rewrite-history
Remove sensitive files and their commits from Git history

I would like to put a Git project on GitHub but it contains certain files with sensitive data (usernames and …

git git-commit git-filter-branch git-rewrite-history
How to amend older Git commit?

I have made 3 git commits, but have not been pushed. How can I amend the older one (ddc6859af44) and (47175…

git version-control git-rewrite-history
Rebasing a Git merge commit

Take the following case: I have some work in a topic branch and now I'm ready to merge back to …

git merge rebase git-rebase git-rewrite-history