Approach
Elegant Git aims to standardize how a work environment should be configured. It operates 3 levels of configurations (basics, standards, and aliases - see below) which 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.