Ranger can show the version control status of files and directories. Symbols are displayed in colors along the right side, beside the file size, to indicate the version control status of those files. For example, a green tick mark is shown if the file is up-to-date. Version control systems that are supported include Git, Mercurial (Hg) and Bazaar.
The version control feature is only available in Ranger v1.6.1 and later. If the version from your distribution is older than this, then you need to get the latest version.
Install latest version
- Before installing the latest version of Ranger, I remove the old one:
$ sudo apt remove ranger
- Install the latest version of Ranger as described here.
Configure version control feature
- To enable version control support, have this line in your
set vcs_aware true
- Next we need to specify which version control systems we want to be supported. For each version control system, are three possible options:
local(use only local information) and
enabled(get remote information too).
For example, to enable Git and Mercurial support with only local information, I add this to
set vcs_backend_git local set vcs_backend_hg local
Open Ranger now in a directory that is inside any repository and you will see the file status information displayed at the right side of the column.
- I found that having VCS enabled made Ranger extremely slow to start. So, I disabled it by default and instead mapped a keyboard shortcut
zgto enable it when I needed it. This can be done by adding these lines to
set vcs_aware false map zg set vcs_aware true
Tried with: Ranger 1.7.2 and Ubuntu 14.04