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 noticing it until now. I want to completely delete the file from the repository history. Is it possible to rewrite the change history such that filename.orig was never added to the repository in the first place? … Read more

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 passwords, like /config/deploy.rb for capistrano). I know I can add these filenames to .gitignore, but this would not remove their history within Git. I also don’t want to start over again by deleting the /.git … Read more

How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script on the school computer, and committing the changes to Git (in a repo that was in my pen drive, cloned from my computer at home). After several commits, I realized I was committing stuff as the root user. Is there any way to change the author of these commits … Read more