Three simple helper scripts for streamlining git workflow.
-
Clone this repo:
git clone https://github.com/yourusername/git-shortcuts.git cd git-shortcuts
-
Make all scripts executable:
chmod +x gi.sh gq.sh gho.sh
-
Add aliases to your
~/.zshrc
:alias gi="$HOME/git-shortcuts/gi.sh" alias gq="$HOME/git-shortcuts/gq.sh" alias gho="$HOME/git-shortcuts/gho.sh"
-
Reload your shell:
source ~/.zshrc
gi https://github.com/username/repo.git
Runs:
git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin <url>
git push -u origin main
gq your commit message here
Runs:
git add .
git commit -m "your commit message here"
git push -u origin main
gho
Opens the GitHub origin URL of the current repository in your default browser.
- Automatically converts SSH URLs to HTTPS format
- Works cross-platform (Linux, macOS, Windows)
- Shows an error if not in a git repository or no origin is set
gi
will abort if a.git
folder already exists in the directory.gq
requires a commit message argument.