Interactive commit using terminal
Erick Navarro

Erick Navarro @cutiko

Joined:
Jan 15, 2018

Interactive commit using terminal

Publish Date: Jan 25 '19
8 2

Hello Everybody! My first post here was looking forward to having something adequate to share :)

icommit

I create a simple script for having an interactive commit using the terminal, you can see the instructions here

icommit demo gif

Instructions for icommit

The problem

Usually, a commit will be something like this:

git commit -am 'ADD: new feature'

Then the next commit will be something like this:

git commit -am 'FIX: the feature was broken'

In every commit always the same pattern is repeated git commit -am 'THE_MESSAGE' so I was wondering how to do it faster.

My first attempt was to press up arrow and delete, but it was tedious, then it hit me:

It would be really cool if I could have something like scanner.readline

Like in the text base adventure games, the interaction was basically writing lines, the program read the input and then do something.

So there you have a bonus, now your version control is an adventure game as well!

Comments 2 total

  • Jesse Phillips
    Jesse PhillipsJan 27, 2019

    My problem is I utilize git gui to break apart my commits but sometimes I want to use commit --fixup so this means staging some changes and jumping to the terminal. If I cared I'd learn to us vim fugitive better.

    • Erick Navarro
      Erick NavarroJan 27, 2019

      My icommit command is not intended for every situation, neither attempt to replace knowing how to use git. The use case here is editing 1 file at the time.

Add comment