Completely remove a file from git master branch history

Basically, you create a new branch that branches at the commit right before you introduced the file you want to remove, use that as an interactive rebase base for master, and force push your rebased master.

– create a new branch from the commit *before* the commit that introduced the file you want to remove
git branch master-2 <sha1-of-commit-to-branch-from>

– check out new branch, make sure history is where you wan it ot be
git checkout master-2 ; git log ;

– go back to master
git checkout master

– interactive rebase master against the new branch
git rebase -i master-2

Here you will need to select ‘e’ for the commit that introduced the file. When the rebase stops on that commit, just do

git rm filename
git rebase --continue

… and after git replays all of master, you’ll have a master branch with new commit hashes that is clean of the offending file.

git , rebase, master, git rebase, history, rewrite history, git history, git security

Make the windows machine at your house on a residential dynamic IP email you its public IP regularly

Wrote a Windows batch file that does exactly what the title of this post says it does. Edit the Mailjet creds (er, sign up for Mailjet first if needed, it’s free) and the email in the batch file and create a Scheduled Task to execute it. You’ll always know your home IP and can remote to your home machine at leisure.

https://bitbucket.org/siliconrockstar/make-your-home-windows-computer-email-you-its-public-ip/src/master/

Sends you an email that looks like

Yay technology 🙂