In cases when you use
git reset --hard to undo some commits, you basically erase commits. In cases you happen to change your mind about the commits you deleted, Git still provides an easy way to restore those commits with the help of reflog.
The reflog is an ordered list of commits which HEAD has ever pointed to. This is often referred to as a safety net which means that you shouldn’t worry about that your data will ever be lost even if you change git history with
git reset or a wrong
rebase. Git reflog allows you to almost always recover your project’s history. I say “almost” because reflog doesn’t store entries forever, but only for configured period of time.
We continue to talk about git and in this post we’ll talk about a few more things that make people confused - viewing old versions of your files and undoing commits.
How to view the old version of my repository?
To view a previous version of your repository, you can use the following command:
$ git checkout <commit> # you need to provide a commit hash or tag
Git log command lets you navigate through the history of your commits. I personally use the following git log command and alias for it quite often:
l = log --all --decorate --oneline --graph
which prints the history of the commits, where it has diverged, commit messages and local branches.
We continue to talk about log shippers and in this part we’re going to look at Fluentd which is next on our list.
Fluentd is another popular tool which is used as a log shipper and log aggregator. People often compare it to Logstash and use it as an alternative. So you might find another version of a popular ELK (Elasticseach+Logstash+Kibana) stack which is called EFK (Elasticsearch+Fluentd+Kibana).
Nowadays, you’ll also see a lot of people use Fluentd for container logging. In fact, it was adapted as a main log collector in Kubernetes. All in all, Fluentd seems very interesting, so let’s find out what it is like …
In this part of our blog series we’re going to look at the most popular opensource tools used for log shipping.
I love reading Sematext blog. These guys are one of the few who write regularly about different logging tools and approaches to setting up a logging system. They have a post about log shipper popularity based on the poll results. Although it dates back to 2014, you may notice that not much changed in the world of log shippers since then and those whose names are on the picture of the poll results haven’t lost their popularity to this day.