Skip to content

Instantly share code, notes, and snippets.

@husamahmud
Created February 6, 2025 16:51
Show Gist options
  • Save husamahmud/9f7f7b5c662dbcbcc161912894935d37 to your computer and use it in GitHub Desktop.
Save husamahmud/9f7f7b5c662dbcbcc161912894935d37 to your computer and use it in GitHub Desktop.
A simple Zsh function to create a push alias for Git that combines git add ., git commit -m "$1", and git push into one command. Add this to your .zshrc for a faster Git workflow.
# Step 1: Open .zshrc in the Terminal
vi ~/.zshrc
# vi ~/.bashrc # For Bash
# Step 2: Add the Alias
push() {
git add .
git commit -m "$1"
git push
}
# Step 3: Reload .zshrc to apply changes
source ~/.zshrc
# source ~/.bashrc # For Bash
# Run the `push` command with your commit message
push "my commit message"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment