From 737cbf30263e748cff429bbadb527734d3085a2b Mon Sep 17 00:00:00 2001 From: Ashutoshbirje Date: Sat, 19 Oct 2024 17:14:25 +0530 Subject: [PATCH 1/2] ok --- commands/gacp/README.md | 28 ++++++++++++++++++++++++++++ commands/gacp/gacp.sh | 22 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 commands/gacp/README.md create mode 100644 commands/gacp/gacp.sh diff --git a/commands/gacp/README.md b/commands/gacp/README.md new file mode 100644 index 0000000..349e19a --- /dev/null +++ b/commands/gacp/README.md @@ -0,0 +1,28 @@ +# Command Name +gacp + +# # Description +The gacp command simplifies the process of adding, committing, and pushing changes to a Git repository. It automates the three most common commands developers use: + +git add . +git commit -m "message" +git push origin main +This saves time by avoiding repetitive manual inputs, especially for frequent commits. + +# # Syntax +'''bash +gacp "commit message" +''' + +# # Features of the Custom Command +1) Simple Workflow Automation
+ +Runs git add ., git commit -m "message", and git push origin main in a single command.
+ +2) Error Handling
+ +Checks if the user has provided a commit message and warns if it’s missing.
+ +3) Optional Branch Handling
+ +By default, pushes to the main branch, but the branch can be customized in future versions.
\ No newline at end of file diff --git a/commands/gacp/gacp.sh b/commands/gacp/gacp.sh new file mode 100644 index 0000000..791a4f3 --- /dev/null +++ b/commands/gacp/gacp.sh @@ -0,0 +1,22 @@ +gacp() { + if [ -z "$1" ]; then + echo "Error: Commit message is required." + echo "Usage: gacp \"commit message\"" + return 1 + fi + + echo "Adding changes..." + git add . + + echo "Committing with message: $1" + git commit -m "$1" + + echo "Pushing to origin main..." + git push origin main + + if [ $? -eq 0 ]; then + echo "Changes successfully pushed to 'main' branch." + else + echo "Error: Failed to push changes." + fi +} From 539701072565af048b63d8bb65055cfa27af35a1 Mon Sep 17 00:00:00 2001 From: Ashutoshbirje Date: Sat, 19 Oct 2024 17:20:06 +0530 Subject: [PATCH 2/2] gacp folder added --- commands/gacp/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/commands/gacp/README.md b/commands/gacp/README.md index 349e19a..f75cde2 100644 --- a/commands/gacp/README.md +++ b/commands/gacp/README.md @@ -1,7 +1,6 @@ -# Command Name -gacp +# gacp -# # Description +## Description The gacp command simplifies the process of adding, committing, and pushing changes to a Git repository. It automates the three most common commands developers use: git add . @@ -9,12 +8,12 @@ git commit -m "message" git push origin main This saves time by avoiding repetitive manual inputs, especially for frequent commits. -# # Syntax -'''bash +## Syntax +```bash gacp "commit message" -''' +``` -# # Features of the Custom Command +## Features of the Custom Command 1) Simple Workflow Automation
Runs git add ., git commit -m "message", and git push origin main in a single command.