When I first started this blog, I simply started with experiments. The first iteration was a _wordpress_ which was followed, very fast, by _joomla_. Neither of them lasted long. They are simply not for me.
I am lucky to be a part of a small group started in `#dgplug` on _Freenode_. In mentioned group, I have access to a lot of cool and awesome people who can put me to shame in development. On the flip side, I live by a _motto_ that says:
> Always surround yourself with people smarter than yourself.
It's the best way to learn. Anyway, back to the topic at hand, they introduced me to _static blog generators_. There my journey started but it started with a trial. I didn't give too much thought to the repository. It moved from _GitHub_ to _Gitlab_ and finally _here_.
But, of course, you know how projects go, right ?
Once you start with one, closely follows other ones that crop up along the way. I put them on my **TODO**, literally. One of those items was that I committed all the images to the repository. It wasn't until a few days ago until I added a `.gitattributes` file. Shameful, I know.
No more ! Today it all changed.
<!--more-->
## First step first {#first-step-first}
Let's talk about what we need to do a little bit before we start. Plan it out in our head before doing the actual work.
I will itemize them here to make it easy to follow:
- Clone a fresh repository to do the work in
- Remove all the images from the _git_ repository
- Add the images again to _git lfs_
Sounds simple enough, doesn't it ?
<divclass="admonition warning">
<pclass="admonition-title">warning</p>
If you follow along this blog post, here's what you can expect.
- You **WILL** lose _all the files you delete from disk_, as well, so make a copy
- You **WILL** re-write history. This means that the _SHA_ of every commit since the first image was committed **WILL** mostly likely change.
- You **WILL** end up essentially with a new repository that shares very little similarities with the original, so **BACKUP**!.
</div>
Now that we got the _warning_ out of the way, let's begin the serious work.
## Clone the repository {#clone-the-repository}
I bet you can do this with your eyes closed by now.
Yes, I use `-v` when I commit from the shell, try it.
The interesting part from the previous step is that _git-filter-repo_ left us without a _remote_. As I said, this repository resembles very little the original one so the decision made by _git-filter-repo_ is correct.
Let's add a **new empty repository**_remote_ to our new repository and push.
Total 338 (delta 128), reused 316 (delta 127), pack-reused 0
remote: Resolving deltas: 100% (128/128), done.
remote: . Processing 1 references
remote: Processed 1 references in total
To git.project42.io:Elia/blog.lazkani.io.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
```
And the deed is done.
<divclass="admonition note">
<pclass="admonition-title">Note</p>
If you were extremely observant so war, you might've noticed that I used the same link again while I said a **new repository**.
Indeed, I did. The old repository was renamed and archived [here](https://gitea.project42.io/Elia/blog.lazkani.io-20200902-historical). A new one with the name of the previous one was created instead.
</div>
## Conclusion {#conclusion}
After I pushed the repository you can notice the change in size. It's not insignificant.
I think it's clearner now. The **1.2MB** size on the _repository_ is no longer