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). So,
- the local configuration applies by running
git elegant acquire-repository
and configures current Git repository by usinggit config --local <key> <value>
- the global configuration invokes by running
git elegant acquire-git
and usesgit 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 configurations - [
l
] - configures only for a local configuration - [
g
] - configures only for a global configuration - [
i
] - if a global configuration is applied, this option isn't used in local configuration; otherwise, uses in local configuration
Also, there are defined the custom configuration keys in addition to
the standard git config
options. These keys will be configured
automatically during acquire-git
or acquire-repository
execution, so, you don't need to set them
manually.
The basics configuration sets the mandatory options for the correct user-focused operation of Git and
Elegant Git. During the configuration, you will be asked to provide appropriate values. Furthermore,
if you acquire-repository
, it proposes defaults that are set by acquire-git
. The basics includes:
- setting your full name usign
user.name
[b
] - setting your email usign
user.email
[b
] - setting a default editor using
core.editor
[b
] - setting protected branches using
elegant-git.protected-branches
[l
] - setting a default development branch using
elegant-git.default-branch
[l
]
The standards configuration adopts the Git setting for painless and user-oriented commands execution for both Git and Elegant Git. It takes into account OS-specific stuff while configuring specific options. All Git options in this configuration have the defined values and any changes to them may affect the designed behavior of the Elegant Git. However, it should not degrade your Git-related experience. So, the following configuration is applied automatically:
core.commentChar |
[i
] enables lines in commit messages starting from#
(|
prefixes lines that should be ignored)apply.whitespace fix
[i
] removes whitespaces when applying a patchfetch.prune true
[i
] keeps remote-tracking references up-to-datefetch.pruneTags false
[i
] does not remove tags while fetching until you specify it explicitly withgit fetch --tags
core.autocrlf input
[i
] solves issues with line endings on either MacOS/Linux withinput
or Windows withtrue
pull.rebase true
[i
] usesrebase
whengit pull
rebase.autoStash false
[i
] don't useautostash
whengit rebase
credential.helper osxkeychain
[i
] configures default credentials storage on MacOS onlyelegant-git.acquired true
[g
] identifies that Elegant Git global configuration is applied
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.
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][https://github.com/bees-hive/elegant-git/issues/new/choose].
The Elegant Git configuration keys:
elegant-git.protected-branches
defines the protected branches (if there are multiple values, they should be separarated with space). By default, themaster
branch treats as protected. The "protected" means that Elegant Git commands for a branch state modification (such assave-work
,polish-work
, etc.) are prohibited to work if the current branch is protected. Also, the protected branches cannot be removed while running Elegant Git commands for serving a repository.elegant-git.acquired
defines whether a user was applied global configuration or not (see approach for the details).elegant-git.default-branch
defines the name of the default development branch. By default, themaster
branch treats as the default one. Depending on an Elegant Git command, it can be a source branch to create a new branch from, a destination branch to rebase work in, a base branch to compare with, a release branch, and can be used in other ways. In other words, the default development branch is "a golden source" of modifications (commits) for any manipulation that needs them.