From ac0fc26960dcbd03a4882edbb149397e2002f8c4 Mon Sep 17 00:00:00 2001 From: Adwaith-Rajesh Date: Sat, 9 Aug 2025 23:04:25 +0530 Subject: [PATCH] updated readme to include add and show message --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6ca61c2..70d3ab1 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,67 @@ pip3 install git-changes ### Initializing -After installing run the below command in a git repo +After installing run the below command in a **git repo** ```console gitc --init ``` -This command will change the default commit template so that we can add out own commit messages to it. -It will also add the post-commit script. - - ### Adding changes with messages +```console +$ git addm file -m 'adding a new file' --type=fix +[fix] adding a new file +``` + +The `--type` is optional. The currently supported choices for `--type` are + +```console +$ git addm -help +usage: gitc-add [-h] -m MESSAGE [--type {feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert}] + +options: + -h, --help show this help message and exit + -m MESSAGE, --message MESSAGE + Message to add + --type {feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert} + The type of the change +``` + + +### Show Message + +To list all the messages that will added to the next commit, run + +```console +$ git show-messages +[fix] new hello file +[fix] adding a new file +[perf] fix some_function +[refactor] change var name +``` + ### Commit +In order to commit with all these message all you have to do is run. + +```console +$ git commit +``` +This will open up commit message editor with all the set message for the current commit. + +![Terminal image](docs/image.png) + +> NOTE: you cannot simply save and exit this file; since this is a template you have to make +> some changes to it. I suggest adding a title that summarizes all these changes. + +After a successful commit all the messages will be automatically removed. + +```console +$ git show-messages +No commit messages yet!.. To add new message run +git addm -m [--type] + +``` + ### Bye...