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
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"
There are multiple options for using it:
$ sagit
Alias it to, e.g. git sadd
:
$ git config alias.sadd '!sagit'
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
Configuration is done by modifying src/config.h
and rebuilding.
If changes didn't apply, try running make clean
before rebuilding again.
Press h
to see help page along with keybindings
Don't forget to set the same BIN_PATH
.
$ make uninstall BIN_PATH="/home/example_user/bin"