Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to enable version control in Ranger

📅 2014-Sep-16 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ ranger, vcs ⬩ 📚 Archive

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

$ sudo apt remove ranger

Configure version control feature

set vcs_aware true

For example, to enable Git and Mercurial support with only local information, I add this to rc.conf:

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.

set vcs_aware false
map zg set vcs_aware true

Tried with: Ranger 1.7.2 and Ubuntu 14.04