It hurts the worst when the person that made you feel so special yesterday, makes you feel so unwanted today. Every time I remember about somebody that I used to know. Enough, that’s History! Talking about history WordPress post also has its own history.
After yesterday, now I know that a post can have many history items. If you don’t already know try to check from your Blog Posts → Choose a Post → Edit. In the top left menu after your site title there is link that says History. If you are like me (make changes every time) You might see histories of your edited post.
The Revisions screen shows any backup copies of your post or page. Each time you save a draft or Update, a revision is saved. WordPress.com will store the last 25 revisions for each post or page on your blog. Revisions allow you to look back at the recent changes you’ve made and revert to an earlier version if necessary.
You might want to see https://en.support.wordpress.com/editors/page-post-revisions/ for more detailed information about history in WordPress post. But if you want something else you can keep reading this post, I will talk about file versioning.
I try not to depend on this feature provided by WordPress because the last time problem with HTML entities thing, You can check this post to know the details. Now I keep posts in separate place, copy paste to publish it, doesn’t sound effective but it’s fun and safe for me.
So what is file versioning?
If you backup files using a program with file versioning, you can go back to drafts of your work that you’ve since saved over. For example, if you deleted a paragraph from a paper a week ago and now you want it back, you can search through all of the previously saved versions of that document until you find a copy that contains the text you’re looking for.
It’s also very useful if your files get corrupted, as you can simply open a version of the document from before it happened and keep working as planned.
Basically this is the same thing like history I talked before but instead of file it’s a post versioning. In a more technical term this thing is called version control system
a system that records changes to a file or set of files over time so that you can recall specific versions later. This is how I usually version my files. Now, let’s talk about what version control I use.
Git & GitHub
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub is a development platform inspired by the way you work. From open source to business, you can host and review code, manage projects, and build software alongside millions of other developers.
They are not the same thing: Git is the tool, GitHub is the service for projects that use Git.
I will not talk to deep about these two things because theoretically it’s really complicated I just know a little in how to use it. It took me years to understand parts by parts of this technology so if You try to mastering these things I suggest You to play it slow don’t rush anything. And now, this is how I use them.
Initializing Local Repository
What is Repository (Git)?
The purpose of Git is to manage a project, or a set of files, as they change over time. Git stores this information in a data structure called a repository. So, repository is a thing :D. First, I have a directory that contains my files which I want to be versioned and the I initialize the repository using commands.
The commands are:
- git init
- git add .
- git commit -m “comment“
Okay, now I have a local repository, why local? because after this I’m going to make it online using Github. I go to github.com → New Repository → Fill the Repository name → Create repository, and the online Repository created, yay! This repository is empty, there will be sets of instructions on how to do next. For me, I will…
push an existing repository from the command line
git remote add origin https://github.com/yuulye/yuulye.wordpress.com-posts.git
git push -u origin master
After executing those commands my online repository is created, refresh the page and I have my files there. Now it’s time to make some changes. This is the command I use to update my files.
git add .
git commit -m "update"
I know this system while I was learning about programming, this mostly used for collaborative works, but for me the main purpose for this system is to version the files so that we can see the history.