Created
September 6, 2024 07:06
-
-
Save ksaitor/bef79c30bc48a0de5ae7311df79fb3c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to your .bashrc or .aliases or .zshrc | |
ship() { | |
if [ $# -eq 0 ]; then | |
message="improvement" # Default commit message | |
else | |
message="$*" # Combine all arguments into a single commit message | |
fi | |
git commit -am"$message" # Commit changes | |
git pull origin HEAD & # Pull and auto-merge changes from the remote repository | |
# Check if the pull was successful | |
wait $! | |
if [ $? -ne 0 ]; then | |
echo "Git pull failed. Resolve conflicts or check for errors before proceeding." | |
return 1 | |
fi | |
git push origin HEAD & | |
} |
next: AI
thinking of adding commit message generation with claude/chatgpt
doing a git diff, passing it to openai/antropic API via curl
inserting it into git commit -am"$message"
might take a few seconds to run and won't be as fast tho
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://x.com/ksaitor/status/1831951628007829694