Skip to content
/ Sagit Public

CLI utility to Selectively Add in Git

License

Notifications You must be signed in to change notification settings

spevnev/Sagit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sagit

Sagit is a small CLI utility which aims to make git add more flexible by allowing to stage changes on a line-by-line basis.

Works on Linux and MacOS

Building and Installing

Requirements: C compiler, ncursesw, pkg-config

$ make install

Note that the default binary installation path is /usr/local/bin, but it can be changed:

$ make install BIN_PATH="/home/example_user/bin"

Usage

There are multiple options for using it:

Directly

$ sagit

Git alias

Alias it to, e.g. git sadd:

$ git config alias.sadd '!sagit'

VSCode integration

You can add keybinding like this to open full screen terminal in VSCode (to keybindings.json):

{
    "key": "KEYBINDING",
    "command": "runCommands",
    "args": {
        "commands": [
            "workbench.action.createTerminalEditor",
            {
                "command": "workbench.action.terminal.sendSequence",
                "args": {
                    "text": "sagit && exit\u000D"
                }
            }
        ]
    }
}

NOTE: \u000D acts like Enter and is used to run the command

Configuring

Configuration is done by modifying src/config.h and rebuilding.
If changes didn't apply, try running make clean before rebuilding again.

Keybindings

Press h to see help page along with keybindings

Uninstalling

Don't forget to set the same BIN_PATH.

$ make uninstall BIN_PATH="/home/example_user/bin"

About

CLI utility to Selectively Add in Git

Resources

License

Stars

Watchers

Forks