Git – Edit Last Commit Message

If you have suddenly noticed that the last commit message is unclear or contains some incorrect information – don’t worry, as the most resent commit message can be easily changed if you haven’t yet pushed the commit to a remote server

To edit the last commit message you have to repeat the git commit command with the --amend option.

The most recent commit message can be changed in a text editor or simply through the command-line interface. (more…)

Git – Undo Last Commit

There can be a lot of situations when you may want to undo the last commit in Git, that you haven’t pushed to a remote server yet.

For example, you have mistakenly committed the wrong files and want to revert the last local commit but keep the changes you made.

Or you may want to revert the last commit and cancel the changes.

Below i will show the both solutions of how to rollback the last commit but keep the changes you made and how to delete the last commit together with the last changes. (more…)

Vagrant: Tutorial for Beginners – In 5 Minutes

What is Vagrant? Vagrant is a simple and easy to use tool that makes it really easy to manage virtual machines from the command-line interface.

Vagrant out of the box supports VirtualBox, Hyper-V, Docker and has the ability to manage other types of machines, like VMWare or Amazon EC2, by using other providers.

In this tutorial i will show how to initialize a new Vagrant environment, download, provision and start a virtual machine, how to SSH into it and how to stop or destroy it after.

This tutorial supposes that you have already installed one of supported virtual providers, like VirtualBox or Docker. (more…)

Check Ubuntu Version: What Version Of Ubuntu Do I Have?

Sooner or later, every person who works with Ubuntu wonders – what version of Ubuntu do i have?

It is especially important to know the version of Ubuntu that you are running if you want to install some software and need to choose which version of Ubuntu the installer should be downloaded for.

From this short note you will learn how to get the complete information about the current version of Ubuntu from the command line. (more…)

Install Docker on Ubuntu-16.04

For ones, who want to build and run Docker containers on Ubuntu-16.04 – first of all it is required to install Docker itself.

To install the latest version of Docker and to be able to upgrade it easily in future – it is recommended to install Docker from the official repository.

In this guide i will show how to install free Docker CE (Community Edition) on Ubuntu-16.04 from the stable official repository, how to verify that it is installed correctly and will show the common post-installation steps to perform. (more…)

YUM – Install Specific Version of Package

By default, yum installs the latest version of a package among the all versions available in enabled repositories.

Often it is required to install not the latest one, but some specific version or downgrade the already installed package to an older version.

In this note i show how to make yum list all available versions of a specified package and how to instruct it to install the particular one. (more…)

Git – Delete Branch (Local or Remote)

Normally, when you start working on some new feature, you create a new branch from the default branch (usually called master) and work inside it.

When the work is done – you merge your branch inside master and create a new one to work on the next feature.

Regardless of whether you are working with a local or remote Git repository, it will be a good practice to always remove unnecessary branches to prevent your repository from becoming a garbage. (more…)

Linux PS Command: Get the Process Start Time and Date

The usual ps -ef or ps aux commands in Linux show the start time of the processes that have been started today.

For the older processes they show the start date or the start year only, but not the start time.

Don’t worry! The start time of the long-running processes in Linux is not lost and you can still get it with the ps command.

To get the full start time and date of the processes – it is just required to tell the ps command to display the lstart field. (more…)