Search Preview
How I removed a file from my git repo history | Funky Penguin
funkypenguin.co.nzWhile making my most recent commit to my blog, I discovered (after the fact) that I’d accidentally committed a screenshot from a customer project, into my /images/ subdirectory.
.co.nz > funkypenguin.co.nz
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Title | How I removed a file from my git repo history | Funky Penguin | ||||||||||||||||||||||||||||||||||||
Text / HTML ratio | 35 % | ||||||||||||||||||||||||||||||||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||||||||||||||||||||||||||||||||
Flash | Excellent! The website does not have any flash contents. | ||||||||||||||||||||||||||||||||||||
Keywords cloud | git repo commit protected BFG commits Skip content file run dirty files bare made screenshot Oct purge Screenshot complete KB | ||||||||||||||||||||||||||||||||||||
Keywords consistency |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
Images | We found 2 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|---|---|
git | 9 | 0.45 % |
repo | 8 | 0.40 % |
commit | 6 | 0.30 % |
protected | 5 | 0.25 % |
BFG | 5 | 0.25 % |
commits | 5 | 0.25 % |
Skip | 4 | 0.20 % |
content | 4 | 0.20 % |
file | 3 | 0.15 % |
run | 3 | 0.15 % |
dirty | 3 | 0.15 % |
files | 3 | 0.15 % |
bare | 3 | 0.15 % |
made | 3 | 0.15 % |
screenshot | 3 | 0.15 % |
Oct | 3 | 0.15 % |
purge | 2 | 0.10 % |
Screenshot | 2 | 0.10 % |
complete | 2 | 0.10 % |
KB | 2 | 0.10 % |
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|---|---|
Skip to | 3 | 0.15 % |
git repo | 3 | 0.15 % |
my git | 3 | 0.15 % |
from my | 3 | 0.15 % |
05 155830png | 3 | 0.15 % |
Oct 05 | 3 | 0.15 % |
at Oct | 3 | 0.15 % |
repo history | 2 | 0.10 % |
expire expire=now | 2 | 0.10 % |
expire=now all | 2 | 0.10 % |
git reflog | 2 | 0.10 % |
reflog expire | 2 | 0.10 % |
into my | 2 | 0.10 % |
my repo | 2 | 0.10 % |
I made | 2 | 0.10 % |
made a | 2 | 0.10 % |
protected commits | 2 | 0.10 % |
all git | 2 | 0.10 % |
git gc | 2 | 0.10 % |
Funky Penguin | 2 | 0.10 % |
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
Oct 05 155830png | 3 | 0.15 % | No |
at Oct 05 | 3 | 0.15 % | No |
from my git | 3 | 0.15 % | No |
my git repo | 3 | 0.15 % | No |
I made a | 2 | 0.10 % | No |
gc prune=now aggressive | 2 | 0.10 % | No |
git reflog expire | 2 | 0.10 % | No |
reflog expire expire=now | 2 | 0.10 % | No |
expire expire=now all | 2 | 0.10 % | No |
Screenshot at Oct | 2 | 0.10 % | No |
expire=now all git | 2 | 0.10 % | No |
all git gc | 2 | 0.10 % | No |
git repo history | 2 | 0.10 % | No |
git gc prune=now | 2 | 0.10 % | No |
files in a | 1 | 0.05 % | No |
Skip links Skip | 1 | 0.05 % | No |
any files in | 1 | 0.05 % | No |
in a protected | 1 | 0.05 % | No |
couldn’t delete any | 1 | 0.05 % | No |
I couldn’t delete | 1 | 0.05 % | No |
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
from my git repo | 3 | 0.15 % | No |
at Oct 05 155830png | 3 | 0.15 % | No |
git reflog expire expire=now | 2 | 0.10 % | No |
reflog expire expire=now all | 2 | 0.10 % | No |
expire expire=now all git | 2 | 0.10 % | No |
Screenshot at Oct 05 | 2 | 0.10 % | No |
expire=now all git gc | 2 | 0.10 % | No |
all git gc prune=now | 2 | 0.10 % | No |
git gc prune=now aggressive | 2 | 0.10 % | No |
my git repo history | 2 | 0.10 % | No |
Skip links Skip to | 1 | 0.05 % | No |
files in a protected | 1 | 0.05 % | No |
a protected commit ie | 1 | 0.05 % | No |
in a protected commit | 1 | 0.05 % | No |
delete any files in | 1 | 0.05 % | No |
any files in a | 1 | 0.05 % | No |
commit ie HEAD so | 1 | 0.05 % | No |
couldn’t delete any files | 1 | 0.05 % | No |
I couldn’t delete any | 1 | 0.05 % | No |
that I couldn’t delete | 1 | 0.05 % | No |
Internal links in - funkypenguin.co.nz
Archive | Funky Penguin
Contact | Funky Penguin
Search | Funky Penguin
How I removed a file from my git repo history | Funky Penguin
OpenStack LBAASv2 failed connection debugging | Funky Penguin
GPU transcoding with Emby / Plex using docker-nvidia | Funky Penguin
KVM VMs on kernel-2.6.32-696.30.1.el6.x86_64 on AMD-based hypervisor fail to boot | Funky Penguin
Should you do microcode updates? | Funky Penguin
Wife-friendly script to transfer media to USB from linux server | Funky Penguin
What is TurtleCoin and why do I care? | Funky Penguin
Funky Penguin | Upgrading the world through the skilled application of technology
Funky Penguin | Upgrading the world through the skilled application of technology
Funky Penguin | Upgrading the world through the skilled application of technology
Funkypenguin.co.nz Spined HTML
How I removed a file from my git repo history | Funky Penguin Skip links Skip to primary navigation Skip to content Skip to footer Menu HomeArchiveContactSearchCookbookResumeKitchen Funky Penguin Upgrading the world through the skilled using of technology How I removed a file from my git repo history David Young 1 min read September 19, 2018 Categories note Tags git While making my most recent commit to my blog, I discovered (after the fact) that I’d unwittingly single-minded a screenshot from a consumer project, into my /images/ subdirectory. While not a big deal (not as if it was a password file!), it’s still an embarrassing bungle, so I wanted to purge it from my git repo and all previous commits. Some research led me to The BFG, a java-based repo-scrubbing tool, which saved me from embarassment. First, I downloaded the latest version of BFG, then I made a “bare” clone of my repo (bare = the git data but not the very files). I ran java -jar bfg-1.13.0.jar --delete-files "Screenshot at Oct 05 15-58-30.png" www.funkypenguin.co.nz.git versus my yellowish repo, but stumbled on this issue: Protected commits ----------------- These are your protected commits, and so their contents will NOT be altered: * commit fdc05636 (protected by 'HEAD') - contains 1 dirty file : - images/Screenshot at Oct 05 15-58-30.png (410.1 KB) WARNING: The dirty content whilom may be removed from other commits, but as the *protected* commits still use it, it will STILL exist in your repository. Details of protected dirty content have been recorded here : /Users/davidy/Downloads/www.funkypenguin.co.nz.git.bfg-report/2018-09-17/22-35-19/protected-dirt/ If you *really* want this content gone, make a transmission commit that removes it, and then run the BFG on a fresh reprinting of your repo. BFG warned me that I couldn’t delete any files in a protected commit (i.e. HEAD), so I made a dummy commit to move HEAD on from the commit including the screenshot, re-bare-cloned the repo, and tried again. This time, success: Deleted files ------------- Filename Git id ------------------------------------------------------- Screenshot at Oct 05 15-58-30.png | b44c3154 (410.1 KB) In total, 8 object ids were changed. Full details are logged here: /Users/davidy/Downloads/www.funkypenguin.co.nz.git.bfg-report/2018-09-17/22-37-28 BFG run is complete! When ready, run: git reflog elapse --expire=now --all && git gc --prune=now --aggressive As instructed, I chdir’d into my repo directory, and ran git reflog elapse --expire=now --all && git gc --prune=now --aggressive to well-constructed the purge. Now the screenshot is gone, and scrubbed from my git repo history 👍 Share Tweet LinkedIn Reddit Previous In appreciation of yellowish (naked) double-D(ashes) Copyright © 2018 Funky Penguin. Site logo penguin icon made by Freepik from Flaticon is licensed by Creative Commons BY 3.0. Made with the Jekyll So Simple theme.