Created
October 1, 2024 22:57
-
-
Save Zeko369/28717791a837bf7d808e88d3322f9aaf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
alias yeet="gt ss" | |
alias yeetpr="git push && gh pr create -a @me -f" | |
yeetfix() { | |
# Merge all arguments into a single string with spaces | |
local commit_message="$*" | |
# Replace spaces in the commit message with dashes for the branch name | |
local branch_name=$(echo "$*" | tr ' ' '-' | tr '[:upper:]' '[:lower:]') | |
# Create a new branch | |
git checkout -b "$branch_name" | |
# Add all changes and commit with the provided message | |
git add . | |
git commit -m "$commit_message" | |
# Push the branch to origin | |
git push -u origin "$branch_name" | |
# Open a PR on GitHub, assigning @me and using -f to fill the PR description | |
local out=$(gh pr create --fill --assignee "@me") | |
# Copy the PR URL to the clipboard | |
echo "$out" | tail -n 1 | pbcopy | |
echo "Branch '$branch_name' created, changes committed, and PR opened with message: '$commit_message' and copied to clipboard" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment