A collection of powerful git aliases designed to boost your productivity and streamline your git workflow . These aliases transform lengthy git commands into short, memorable shortcuts, helping developers work more efficiently with version control.
Git aliases are custom shortcuts that save time and reduce typing when working with git commands. Instead of typing
git status
, you can simply type gst
. These aliases are particularly valuable for:
- Increased Productivity: Reduce keystrokes by up to 70% on common git operations
- Muscle Memory: Short, consistent aliases become second nature quickly
- Reduced Errors: Less typing means fewer typos in critical git commands
- Workflow Optimization: Complex command sequences become simple one-liners
This collection includes carefully selected aliases for the most common git operations:
g
- gitgst
- git statusga
- git addgcm
- git commit -mgc
- git checkoutgcb
- git checkout -b
gp
- git pushgl
- git pullgpr
- git pull --rebasegf
- git fetchgfa
- git fetch --allgclone
- git clonegr
- git remote
gbd
- git branch -Dgm
- git mergegrb
- git rebasegcp
- git cherry-pick
glog
- git log .gcl
- git config --list
grs
- git reset --softgrh
- git reset --hardgstash
- git stash push -m
gpo
- git push origin -u (current branch)pr
- Push current branch and create PR with GitHub CLI
Run the installation script:
./install-unix.sh
This script works for any Unix-based OS, including macOS, Linux, and WSL.
Run the installation script in Git Bash:
./install-windows.sh
Note: This script is designed for bash environments (Git Bash, WSL). After installation, you can set Git Bash as your default terminal in VS Code for the best experience.
For Windows users, we recommend using Git Bash as your default terminal in VS Code to fully utilize these git aliases:
- Open VS Code
- Press
Ctrl+Shift+P
to open the Command Palette - Type "Terminal: Select Default Profile" and select it
- Choose "Git Bash" from the list
- Open a new terminal with `Ctrl+`` (backtick) - it will now use Git Bash
-
Open VS Code Settings (
Ctrl+,
) -
Search for "terminal integrated shell"
-
Click "Edit in settings.json"
-
Add or update this setting:
{ "terminal.integrated.defaultProfile.windows": "Git Bash" }
If Git Bash doesn't appear in the list, you can manually configure it:
-
Open VS Code Settings (
Ctrl+,
) -
Search for "terminal integrated profiles"
-
Click "Edit in settings.json"
-
Add this configuration:
{ "terminal.integrated.profiles.windows": { "Git Bash": { "path": "C:\\Program Files\\Git\\bin\\bash.exe", "args": ["--login"] } }, "terminal.integrated.defaultProfile.windows": "Git Bash" }
Note: Adjust the path if Git is installed in a different location.
If Git Bash doesn't appear as an option:
- Make sure Git for Windows is properly installed
- Restart VS Code after installing Git
- Check that Git Bash is located at:
C:\Program Files\Git\bin\bash.exe
- Use Method 3 above to manually configure the path
If the aliases don't work after installation:
- Close and reopen your terminal
- Or run:
source ~/.bashrc
(orsource ~/.bash_profile
depending on your config) - Make sure you're using Git Bash, not PowerShell or Command Prompt
- Git (obviously!)
- For the
pr
alias: GitHub CLI installed and configured - macOS/Linux: Zsh or Bash shell
- Windows: Git Bash, WSL, or any bash-compatible environment
Feel free to suggest additional aliases that would improve git productivity. Create an issue or submit a pull request with your recommendations!