Approach
Elegant Git aims to standardize how a work environment should be configured. It operates several levels of configurations (see below) that can be applied to a Git repository (local configuration) and/or to a Git installation globally (global configuration).
The local configuration applies by running
git elegant acquire-repository
and configures current Git
repository by using git config --local <key> <value>
.
The global configuration invokes by git elegant acquire-git
and uses
git config --global <key> <value>
for Git configuration.
If you've applied a global configuration, there is no sense to repeat some options for a local one. That's why the following markers explain how each particular option will be configured:
b
- configures for both configurationsl
- configures only for a local configurationg
- configures only for a global configurationi
- if a global configuration is applied, an option isn't used in local configuration; otherwise, uses in local configuration
Basics
The basics configuration configures the following options git config
options:
user.name
(b
)user.email
(b
)core.editor
(i
)
During the configuration, you will be asked to provide appropriate values.
Standards
The standards configuration configures a set of the git config
options which both handle
OS-specific configurations and add specific options for the correct execution of Elegant Git
commands. It consists of
- setting
core.commentChar
(i
) to|
enables commit messages starting from#
- setting
apply.whitespace
(i
) tofix
removes whitespaces when applying a patch - setting
fetch.prune
(i
) totrue
keeps remote-tracking references up-to-date - setting
fetch.pruneTags
(i
) tofalse
does not remove tags until you specify it explicitly (git fetch --tags
) - setting
core.autocrlf
(i
) to eitherinput
on MacOS/Linux ortrue
on Windows solves issues with line endings - setting
pull.rebase
(i
) totrue
usesrebase
whengit pull
- setting
rebase.autoStash
(i
) tofalse
usesautostash
never whengit rebase
- setting
credential.helper
(i
) toosxkeychain
on MacOS configures default credentials storage - setting
elegant.acquired
(g
) totrue
identifies that Elegant Git global configuration is applied
Aliases
In order to make Elegant Git command like a native Git command, each Elegant Git command will have
an appropriate alias like git elegant save-work
will become git save-work
. This should
significantly improve user experience.
The configuration is a call of git config "alias.<command>" "elegant <command>"
(i
) for each Elegant
Git command.
Signature
This configuration aims to say Git how to sign commits, tags, and other objects you create. It starts after all other configurations. In the beginning, all available signing keys will be shown. Then, you need to choose the key that will be used to make signatures. If the key is provided, the configuration triggers, otherwise, it does not apply. The signing configuration consists of
- setting
user.signingkey
(l
) to a provided value - setting
gpg.program
(l
) to a full path ofgpg
program - setting
commit.gpgsign
(l
) totrue
- setting
tag.forceSignAnnotated
(l
) totrue
- setting
tag.gpgSign
(l
) totrue
For now, only gpg
is supported. If you need other tools, please create a new feature request.