GCommit is a git-plugin that eases how to commit when you need to sign for more than one person -- pair and mob programming reality.
Instead of having to set manually the other developers names, you can define once in a configuration file, and simply reference it at any commit-time.
There are three methods for installing GCommit
Windows users, help us! Check this issue :)
GCommit is available at the Arch User Repository, so you can easily install via yay
yay -S gcommit-git
First, ensure you have libcrypt.so.1
available in your system.
Then head to releases page, download the latest g-commit-<OS>-latest.kexe
¹ and store into a directory within your $PATH
.
Make sure these three things:
- it is called
git-gcommit
- it is placed within your
$PATH
- it is executable
¹ if you're a linux user, the
ubuntu
build should work just fine
If you're interested in building it manually,
# build the GCommit executable
./gradlew build
# copy to a directory within your PATH and name it "git-commit"
sudo cp build/bin/native/releaseExecutable/g-commit.kexe /usr/local/bin/git-commit
GCommit relies on a configuration file gcommit.conf.json
. In it, there are two settings you define:
- the team
Each member of the team is defined by:
- the name to be displayed
- the email to be displayed
- a tag to act as a reference
So, for instance, a team member can be defined in gcommit.conf.json
as follows:
{
"team": [
{
"name": "John Doe",
"email": "[email protected]",
"tag": "JOD"
},
{
"name": "Jane Doe",
"email": "[email protected]",
"tag": "JAD"
}
],
// ... other aspects ...
}
GCommit makes it easier to sign commits by providing a quick reference to a stored team member. The tag is the "quick reference". So make sure to inform unique tags ;)
- the signature format
GCommit works for multiple Code Repository platforms, such as GitHub and GitLab -- so far, that's all GCommit supports.
Each platform has its own signature template to account activities for users, so you can configure which format to adopt.
Out-of-the-box, GCommit supports GitHub's Co-authored-by: Name <email>
(default)
and GitLab's Signed-off-by: Name <email>
.
In the config file, you can choose which format to use:
{
// ... other aspects ...
"format": "GCommit/GitLab"
}
in case you wish to follow GitHub's format instead, use
"GCommit/GitHub"
or even don't define the format since it's the default
Place the gcommit.conf.json
at the root of the project, and we recommend to add it to Git Ignore file.
Then, after adding changes to git staging area, simply run
git gcommit JOD JAD
in the case you want to sign with the entire team, you can simply run
git gcommit
with no arguments
In case there are no changes to commit the commit file won´t be opened and you will get the message:
gcommit: nothing to commit, working tree clean
check your directory and run again
Please refer to CONTRIBUTING.md
Many thanks to all contributors!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This project is licensed under the MIT License