Elegant Git is an assistant who carefully automates routine work with Git.
- unified local full-cycle work management for any Git repository
- local flexible continuous integration (aka workflows)
- preserve current Git state prior to command execution and restore after (aka pipes)
- actual work is allowed in custom branches only
- all pushes to
masterare strictly controlled
- all commands, which modify a state of Git, are printed
- declarative interaction matters
While developing something, it may be required to format code prior to committing changes or to open several URLs to report release notes after a new release. All these and similar actions, which you have to perform in addition to git actions, are your workflows. And Elegant Git allows automating them (it's like Git Hooks, but for Elegant Git commands).
There are personal and common actions. The personal actions are stored in
directory while the common actions are located in
.workflows/ directory within the repository.
That's why there is an ability to split what should be configured for any contributor and what's for
An action will be automatically triggered if an executable file is placed in a directory for either
personal or common actions. The executable file name has
<Git Elegant command>-<type> pattern
<Git Elegant command> is one of the commands and
<type> is either
(runs prior to the command) or
after (runs after to the command).
A sample workflow execution:
==>> git elegant save-work .git/.workflows/save-work-ahead .workflows/save-work-ahead # the command itself .git/.workflows/save-work-after .workflows/save-work-after
❗Please take into that if an action returns a non-zero exit code, the execution of the workflow will be interrupted.
If you want to skip workflows for the current command execution, just use
git elegant --no-workflows save-work.
There are a lot of situations when a current Git state needs to be reserved prior to Elegant Git
commands execution. For instance, you are working on something. And now, urgently, you need to
accept someone's critical work -
git-elegant accept-work some-critical-branch. But there are
uncommitted modifications that need to be stashed prior to accepting work. From the other side, it
will be good to back into the previous working branch and restore modification from the stash when
the needed work is accepted. That's why there are pipes which are doing preserve and restore
There are the following pipes:
- branch pipe which preserves and restores current branch
- stash pipe which preserves and restores uncommitted changes
A command can use one or several pipes at the same time (see command help for the details).
And if a "piped" command is used, each pipe stores the state within repository configuration (using
git config --local), runs the original command, and restores saved state if the command is
successful. If the command is failed and it reruns, the pipes do not preserve the state again but
will restore the initial preserved state if the command is successful.
Support only one default remote -
Usually, Elegant Git translates exit codes of original Git commands. However, in some cases, it may face its own errors and raises them as
0- a successful execution
42- a philosophical constraint
43- a logical constraint
45- a required parameter is empty
46- an unknown command