How do you fix a bad merge, and replay your good commits onto a fixed merge?

Please don’t use this recipe if your situation is not the one described in the question. This recipe is for fixing a bad merge, and replaying your good commits onto a fixed merge. Although filter-branch will do what you want, it is quite a complex command and I would probably choose to do this with … Read more

Remove sensitive files and their commits from Git history

For all practical purposes, the first thing you should be worried about is CHANGING YOUR PASSWORDS! It’s not clear from your question whether your git repository is entirely local or whether you have a remote repository elsewhere yet; if it is remote and not secured from others you have a problem. If anyone has cloned … Read more

How to remove/delete a large file from commit history in the Git repository?

Use the BFG Repo-Cleaner, a simpler, faster alternative to git-filter-branch specifically designed for removing unwanted files from Git history. Carefully follow the usage instructions, the core part is just this: $ java -jar bfg.jar –strip-blobs-bigger-than 100M my-repo.git Any files over 100MB in size (that aren’t in your latest commit) will be removed from your Git … Read more

How can one change the timestamp of an old commit in Git?

You can do an interactive rebase and choose edit for the commit whose date you would like to alter. When the rebase process stops for amending the commit you type in for instance: git commit –amend –date=”Wed Feb 16 14:00 2011 +0100″ –no-edit P.S. –date=now will use the current time. Afterward, you continue your interactive … Read more

How do I change the author and committer name/email for multiple commits?

NOTE: This answer changes SHA1s, so take care when using it on a branch that has already been pushed. If you only want to fix the spelling of a name or update an old email, Git lets you do this without rewriting history using .mailmap. See my other answer. Using Rebase First, if you haven’t … Read more

How do I modify a specific commit?

Use git rebase. For example, to modify commit bbc643cd, run: $ git rebase –interactive ‘bbc643cd^’ Please note the caret ^ at the end of the command, because you need actually to rebase back to the commit before the one you wish to modify. In the default editor, modify pick to edit in the line mentioning … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)