From 6d050c4620c81ec25b73a526b5057f243c6d7b8a Mon Sep 17 00:00:00 2001 From: Wesley Scholl <128409641+wesleyscholl@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:46:20 -0400 Subject: [PATCH 1/4] CRS-12345 - Commit xyz --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed72765..a0a781f 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,19 @@ To https://github.com/wesleyscholl/git-commit-push-script.git c76b73c..be6fe58 CRS-12345-Git-Script-Test -> CRS-12345-Git-Script-Test ``` -9. Enjoy the script! +## Troubleshooting + +You may encounter an error from the following command because of the `-S` flag: +```shell +git commit -S -m "" +``` +To resolve this error, remove the `-S` from the command in the `git-commit-push-script.sh` file: +```shell +git commit -m "" +``` +If you want to use the -S flag, configure your Git configuration to use the GPG key for signing commits. +Use the guide here: https://totalwine.atlassian.net/wiki/spaces/TP/pages/3155263556/Setting+up+your+Github+Account#Setting-up-a-GitHub-Signing-Key + ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. From 8bd638918bf69b162d59ec70198774a57c0a9f6c Mon Sep 17 00:00:00 2001 From: Wesley Scholl <128409641+wesleyscholl@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:46:41 -0400 Subject: [PATCH 2/4] CRS-12345 - test --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a0a781f..511e394 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,6 @@ git commit -m "" If you want to use the -S flag, configure your Git configuration to use the GPG key for signing commits. Use the guide here: https://totalwine.atlassian.net/wiki/spaces/TP/pages/3155263556/Setting+up+your+Github+Account#Setting-up-a-GitHub-Signing-Key - ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. From f13ef87c2e748eb1753657fe4d4899daae24984e Mon Sep 17 00:00:00 2001 From: Wesley Scholl <128409641+wesleyscholl@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:52:46 -0400 Subject: [PATCH 3/4] CRS-12345 Test 123 --- git-commit-push-script.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/git-commit-push-script.sh b/git-commit-push-script.sh index e63423b..ed63351 100755 --- a/git-commit-push-script.sh +++ b/git-commit-push-script.sh @@ -12,11 +12,21 @@ ticket=$(echo $base_branch | grep -o -E '([A-Za-z]+-[0-9]{3,}|[A-Za-z]+-[0-9]{3, # Prompt for commit message read -p "Enter commit message: " message -echo "Commit message: $ticket - $message" +echo "Commit message: $ticket $message" # Prepare and execute commit command -git commit -S -m "$ticket - $message" +git commit -S -m "$ticket $message" -# Push changes -git push +# Check if the branch exists on the remote +remote_branch=$(git ls-remote --heads origin $base_branch) + +if [ -z "$remote_branch" ]; then + echo "Branch '$base_branch' does not exist on remote. Creating it." + # Push the local branch to the remote, setting the upstream branch + git push --set-upstream origin $base_branch +else + echo "Branch '$base_branch' exists on remote. Pushing changes." + # Push changes to the remote + git push +fi From 88b2d7629dfa7d477292e8870e1355f8c02f2b76 Mon Sep 17 00:00:00 2001 From: Wesley Scholl <128409641+wesleyscholl@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:54:15 -0400 Subject: [PATCH 4/4] CRS-98765 Added new url --- README.md | 2 +- git-commit-push-script.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 511e394..cdcc71a 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ To resolve this error, remove the `-S` from the command in the `git-commit-push- git commit -m "" ``` If you want to use the -S flag, configure your Git configuration to use the GPG key for signing commits. -Use the guide here: https://totalwine.atlassian.net/wiki/spaces/TP/pages/3155263556/Setting+up+your+Github+Account#Setting-up-a-GitHub-Signing-Key +Use the guide here: https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/git-commit-push-script.sh b/git-commit-push-script.sh index ed63351..097576d 100755 --- a/git-commit-push-script.sh +++ b/git-commit-push-script.sh @@ -29,4 +29,3 @@ else # Push changes to the remote git push fi -