DEV Community

Srebalaji Thirumalai
Srebalaji Thirumalai

Posted on • Originally published at gitbetter.substack.com on

Forgit - A utility tool to use git interactively

This post was originally posted in the newsletter GitBetter. If you are interested in leveling up your game in Git, you can subscribe to it.

Forgit is a lightweight CLI tool that helps you to use Git interactively. This tool is a very useful tool that helps you to work effectively.

You can view the repo here.

Installation

This tool uses fzf.So don’t forget to download it.

To install fzf, follow these instructions for your respective platforms.

To install Forgit,

  1. Download the source from the repo.

  2. Open .bashrc or .zshrc and add forgit.plugin.sh or forgit.plugin.zsh.

  3. source .bashrc or source .zshrc

Usage

Some of the useful commands in Forgit

git add

The default command is ga

https://raw.githubusercontent.com/wfxr/i/master/forgit-ga.png

In the above image, you can see the interactive screen.

You can use arrow keys to navigate up and down.

Use Tab and Shift-Tab to add/remove the file.

git log

The default command is glo

screenshot

As the tool uses fzf, you can fuzzy search the logs.

git stash

The default command is gss

Change default alias

Forgit also gives the option to change the default aliases.

Just configure these variables in your shell and source it. Some of the common variables are:

forgit_log=glo

forgit_diff=gd

forgit_add=ga

forgit_stash_show=gss

forgit_cherry_pick=gcp

For the full list of options, you can see this configuration to change the aliases.

Forgit may take some time to fit in your workflow but it’s a very useful tool that comes in handy in many places.

Thank you for reading :)

This post was originally posted in the newsletter GitBetter. If you are interested in leveling up your game in Git, you can subscribe to it.

Discussion (1)

Collapse
allericksha profile image
Sunil Vijay

Very cool ✌🏻πŸ”₯