| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
Staging, committing, and pushing code is a repetative manual process. Writing detailed commit messages and adding ticket numbers should be automated using AI. Save time using this shell script powered by Ollama and Mistral AI.
| Name | Description |
|---|---|
| Git Staging | Staging any modified files for commit using git add -A. |
| Git Commit Message Ticket Title | Copying the ticket number of the Jira ticket as the commit message prefix. Example: [CRS-12345]. |
| Writing Commit Messages Using AI | The script uses Ollama and Mistral AI to generate commit messages using git diff --cached. |
| Git Commit | Committing staged files with the commit message using git commit -S -m "<commit message>". |
| Entering SSH Passphrase | If the SSH key is passphrase protected, the script will enter the passphrase automatically using an env variable (Ex. GIT_SSH_PASSPHRASE). |
| Git Fetch & Pull | Pulling the latest changes from the remote branch with git fetch origin <branch> & git pull. |
| Git Push | Pushing local commits to remote branch with git push. |
| Git Push Retry (Pull & Push) | If a push fails, the script will git pull from the remote branch and push again. |
| Name | Description | Link, Location, or Command |
|---|---|---|
| Terminal or Shell | A terminal or shell for configuring and running the script. | Download Terminal |
| Git Bash *Required for Windows | Git Bash provides a Unix command line emulator for windows which can be used to run Git, shell commands, and much more. | Download Git Bash |
| Ollama | Ollama must be installed and configured. | Get Ollama |
| Mistral AI Model | The Mistral AI model must be downloaded and running locally. Example: ollama pull mistral | Get Mistral |
| Alias Command (optional) | The alias command to be used for the script: cm. | Bash profile (.zshrc or .bash_profile) |
| SSH Key (optional) | If you want to use SSH for Git operations, you will need to configure your SSH key. | Git SSH Key Guide |
| GPG Key (optional) | If you want to sign your commits, you will need to configure your GPG key in Git. | Git GPG Key Guide |
git clone https://github.com/wesleyscholl/git-commit-push-script.gitcd git-commit-push-scriptchmod +x git-commit-push-script.shalias cm='bash /path/to/git-commit-push-script/git-commit-push-script.sh'homebrew install ollama
# AND/OR #
ollama serveollama pull mistralsource ~/.zshrc
# OR #
source ~/.bash_profilecm
# OR #
./git-commit-push-script.shargo-gr-cr-test git:(WXYZ-1234) cm
Removed sync options, enabled cron workflow
spawn git commit -S -m WXYZ-1234 Removed sync options, enabled cron workflow
Enter passphrase for "/Users/wscholl/.ssh/id_ed25519":
[WXYZ-1234 94f179e] WXYZ-1234 Removed sync options, enabled cron workflow
1 file changed, 7 deletions(-)
Branch 'WXYZ-1234' exists on remote.
Pulling latest changes from remote branch...
From https://github.com/myOrg/argo-gr-cr-test
* branch WXYZ-1234 -> FETCH_HEAD
Already up to date.
Pushing changes to remote WXYZ-1234 branch...
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 671 bytes | 671.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To https://github.com/myOrg/argo-gr-cr-test.git
f546666..94f179e WXYZ-1234 -> WXYZ-1234You may encounter an error from the following command because of the -S flag:
git commit -S -m "<commit message>"To resolve this error, remove the -S from the command in the git-commit-push-script.sh file:
git commit -m "<commit message>"Or 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://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
Transform git-commit-push-script into the industry standard for AI-powered Git workflow automation, enabling developers to focus on creative problem-solving while AI handles the repetitive aspects of version control. Target: 100,000+ active users by 2027.
This project is licensed under the MIT License - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |