Created
February 6, 2025 16:51
-
-
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.
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
# 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